Class: Engine

Simplicite.UI.Engine

new Engine

Main UI Controller with abstract view to display components.

  • Controller implements the UI logic with interactions between components (list, form, menu...) and the data (ajax).
  • It does not contain UI drawing and must load the view service to display controls.
  • Each View engine implements the UI interfaces (without data access) and interacts with the controller (to access to data).

Source:
  • controller.js, line 30

Members

grant

User rights

Source:
  • controller.js, line 101

KEYS

Common key codes

  • BACKSPACE
  • TAB
  • ENTER
  • SHIFT
  • CTRL
  • ALT
  • PAUSE
  • CAPS_LOCK
  • ESCAPE
  • PAGE_UP
  • PAGE_DOWN
  • END
  • HOME
  • LEFT_ARROW
  • UP_ARROW
  • RIGHT_ARROW
  • DOWN_ARROW
  • INSERT
  • DELETE

Source:
  • controller.js, line 6364

MEDIA_SIZE

Media sizes (XS=544, SM=768, MD=992, LG=1200)

Source:
  • controller.js, line 2203

options

global options: merge of the launch parameters with Simplicite.UI.Globals

Source:
  • controller.js, line 43

screenSize

Current screen size {w,h}

Source:
  • controller.js, line 2245

view

View main renderer

Source:
  • controller.js, line 107

Methods

addShortcuts

Add keys shortcuts to document

Parameters:
Name Type Description
keys object pair of ('ctrl' + 'shift' + 'alt') + letter or char-code = callback or shortcut definition
Source:
  • controller.js, line 881

alert

Alert dialog box

Parameters:
Name Type Description
params string | object message or object with:
Properties
Name Type Description
name string optional name
title string optional title, default "ALERT"
type string optional 'error|danger|warning|info'
content string | jQuery optional alert body
help string | jQuery optional help
onOk function optional callback on "OK" button
dontAskAgain string use the 'dont't ask again' local storage (true=keep user's action or string=forced response), needs a name
toast boolean true to display a toast instead a modal dialog
Source:
  • controller.js, line 1176

applyConstraints

Apply constraints

Parameters:
Name Type Description
ctn jquery Container
obj Simplicite.Ajax.BusinessObject Object
elt string Optional DOM element (input, select, textarea) with data {field, index}
index string Optional editlist line index
context number Optional context (default Simplicite.CONTEXT_UPDATE)
cbk function Optional callback
Source:
  • controller.js, line 5103

backendException

Back-end exception

Parameters:
Name Type Description
msg string | object | array Simple text or { level, message or messages }, or first item of array
Source:
  • controller.js, line 1611

backendMessage

Back-end message(s)

Parameters:
Name Type Description
msg string | object | array plain text / encoded message (code:text#level) / object { code, level, text, label } / or array of messages
toast boolean true to display a toast instead a dialog box
Source:
  • controller.js, line 1588

bind

Bind one UI action with implementation

Parameters:
Name Type Description
name string action name
fn function handler
Source:
  • controller.js, line 1663

bindChange

Attach change event to fields

  • set the hasChanged on object
  • apply related constraints

Parameters:
Name Type Description
ctn jquery container
obj Simplicite.Ajax.BusinessObject | Simplicite.Ajax.BusinessProcess Object or Process
selector string optional selector (default: input, select and textarea)
Source:
  • controller.js, line 5080

bindEnabled

Enable action binding

Parameters:
Name Type Description
name string action name
enable boolean true to activate / false to disable binding
Source:
  • controller.js, line 1677

bindGenericActions

Bind generic actions

Source:
  • controller.js, line 1935

bindSaveAndQuit

Manage the save and close when fields have changed

Parameters:
Name Type Description
ctn jquery Container
obj Simplicite.Ajax.BusinessObject | Simplicite.Ajax.BusinessProcess Object or Process
p object parameters { msg, msgRow }
save function save handler
Source:
  • controller.js, line 5143

canCloseContent

Checks if the content can close

Parameters:
Name Type Description
ctn jquery container
cbk function callback if the content can close
Source:
  • controller.js, line 5049

clearCache

System clear cache

Parameters:
Name Type Description
action string cc|dc|gc for server, all sessions or granted user
Source:
  • controller.js, line 5521

clickDocument

Click on a document: open the document

Parameters:
Name Type Description
doc object document data
Properties
Name Type Description
object object object name
field object doc field name
rowId object row ID
docId object document ID
name object document name
Source:
  • controller.js, line 4400

clickImage

Click on image: default open a dialog with the image

Parameters:
Name Type Description
doc object image data
Properties
Name Type Description
object object object name
field object doc field name
rowId object row ID
docId object image ID
name object image name
Source:
  • controller.js, line 4442

clickMenu

Main menu handler

Parameters:
Name Type Description
item object Menu item
Properties
Name Type Description
label string displayed label
object string optional object name
state string optional object state filter
search boolean true to force the search dialog
workflow string optional screenflow name
process string optional process name
step string optional step filter
bam string optional object name for metrics view
tray string optional object name for trays view
domain string optional domain home
view string optional view name
href string optional URL
target string optional href target
Source:
  • controller.js, line 938

clickReference

Click on a reference: default displayForm

Parameters:
Name Type Description
ctn string | jquery Target container
obj string | Simplicite.Ajax.BusinessObject name or Business Object
rowId string Referenced row ID
Source:
  • controller.js, line 3842

clickShortcut

Shortcut handler

Parameters:
Name Type Description
item { url, target, label }
Source:
  • controller.js, line 867

closeForm

Close the object form: default going back in navigation

Parameters:
Name Type Description
ctn jquery Container
obj Simplicite.Ajax.BusinessObject Business object
rowId string object row ID
Source:
  • controller.js, line 5897

compat

Forward compatibility: wrap legacy API to UI (getTop, openInFrame...)

Parameters:
Name Type Description
w object optional window
silent boolean ignore console message
nodlg boolean ignore dialog
Source:
  • controller.js, line 6412

confirm

Confirm dialog box

Parameters:
Name Type Description
params string | object message or object with:
Properties
Name Type Description
name string optional name
title string optional title, default "CONFIRM"
content string | jQuery optional alert body
help string | jQuery optional help
onOk function optional callback on "OK" button
onCancel function optional callback on "CANCEL" button
dontAskAgain string use the 'dont't ask again' local storage (true=keep user's action or string=forced response), needs a name
Source:
  • controller.js, line 1235

contentLoaded

Prepare content handlers

Parameters:
Name Type Description
ctn jquery container
onload function optional load handler
onunload function optional unload handler
params boolean optional context parameters
Source:
  • controller.js, line 5020

copyToClipboard

Copy a text to clipboard

Parameters:
Name Type Description
text string text to copy
silent boolean hide the toast
Source:
  • controller.js, line 1639

countList

Count rows with context and filters

Parameters:
Name Type Description
obj string | Simplicite.Ajax.BusinessObject name or Business Object
options Simplicite.UI.Globals.list options to override Globals
cbk function Optional callback(obj) to read obj.count
Source:
  • controller.js, line 3133

countReference

Count references of a parent object in PANELLIST context

Parameters:
Name Type Description
obj string referenced object name or business object
parent object specify the parent object and the foreign-key { name, inst, field, rowId }
cbk function Callback(obj, count)
Source:
  • controller.js, line 3794

createReference

Create an object in a dialog

Parameters:
Name Type Description
ctn string | jquery Parent container to populate
obj string | Simplicite.Ajax.BusinessObject Object
ref string | Simplicite.Ajax.ObjectField Referenced field or FK itself
index string Optional row index (edit list)
Source:
  • controller.js, line 3997

dispatchMessages

Set visible field messages and returns other/head messages

Parameters:
Name Type Description
messages (string | object)[] Backend messages code:text#level[#field] (or json object)
obj Simplicite.Ajax.BusinessObject Optional object to affect message when #field matches
Source:
  • controller.js, line 5618

displayAssociate

Bulk association between objects

Parameters:
Name Type Description
ctn string | jquery Parent container
obj Simplicite.Ajax.BusinessObject Object from panel instance
def object Associate definition
Properties
Name Type Description
parent string parent object name
parentRefField string foreign key field to parent
child string optional child object name (when obj is a N,N relationship)
childRefField string foreign key field to child
Source:
  • controller.js, line 4189

displayColorPicker

Color picker

Parameters:
Name Type Description
ctn string | jquery Container
input string | jquery element to receive selected color as #RRGGBB
dropdown boolean displays as dropdown or dialog box
cbk function optional callback(color,valid)
Source:
  • controller.js, line 6331

displayCompletion

Field completion on field

Parameters:
Name Type Description
ctn string | jquery Container
obj string | Simplicite.Ajax.BusinessObject) Object or name
field string | Simplicite.Ajax.ObjectField) Field or name
index string Optional row index (edit list)
req string User request
cbk function Callback with search result
Source:
  • controller.js, line 5244

displayCrosstab

Crosstab

Parameters:
Name Type Description
ctn string | jQuery Container
obj string | Simplicite.Ajax.BusinessObject name or Object
name string Crosstab name
options object { inst, filters, options, nav, showNav }
Properties
Name Type Description
inst string instance of object
filters object optional filters to limit crosstab data
options object[] optional crosstab options (zstotal, zstcolor, zcaption, ztable, zgraph...)
cbk function optional callback
Source:
  • controller.js, line 3270

displayForm

Build a form with the object item

Parameters:
Name Type Description
ctn string | jquery Target container
obj string | Simplicite.Ajax.BusinessObject Object
rowId string row ID to get
options Simplicite.UI.Globals.form options to override globals
cbk function Optional callback(obj, params)
Source:
  • controller.js, line 4511

displayHelp

Object help: call the help service and open a dialog

Parameters:
Name Type Description
ctn string | jquery Parent container
obj Simplicite.Ajax.BusinessObject Object
Source:
  • controller.js, line 4460

displayHome

Home page

Parameters:
Name Type Description
ctn string | jquery Container
options object { nav, showNav }
cbk function optional callback
Source:
  • controller.js, line 1039

displayIndex

Index search form

Parameters:
Name Type Description
ctn string | jquery Container
options object Options
Properties
Name Type Description
title string search title, the request by default
nav string 'add' or 'new' (default)
showNav boolean display the navigation railway, default true
object string optional business object to limit search
domain string optional domain search
cbk function optional callback
Source:
  • controller.js, line 3386

displayIndexSearch

Index search result

Parameters:
Name Type Description
ctn string | jquery Container
req string User request (see Simplicite.Ajax.indexsearch service)
options object { object, nav, showNav }
cbk function optional callback
Source:
  • controller.js, line 3487

displayIndexSearchDocs

Index search in documents

Parameters:
Name Type Description
ctn string | jquery Container for result
req string user request
list string[] Array of objects with documents
options object { object, nav, showNav }
Source:
  • controller.js, line 3469

displayIndexSearchDomain

Index search in domain

Parameters:
Name Type Description
ctn string | jquery Container for result
domain string Domain name
all boolean false to limit search to objects updated by the user
options object { object, nav, showNav }
Source:
  • controller.js, line 3452

displayIndexSearchSession

Session index

Parameters:
Name Type Description
ctn string | jquery Container for result
Source:
  • controller.js, line 3427

displayList

Build a list with the object search

Parameters:
Name Type Description
ctn string | jquery Target container
obj string | Simplicite.Ajax.BusinessObject name or Business Object
options Simplicite.UI.Globals.list options to override Globals
cbk function Optional callback
Source:
  • controller.js, line 2768

displayMerge

Merge

Parameters:
Name Type Description
ctn string | jQuery Container
obj string | Simplicite.Ajax.BusinessObject name or Object
options object { inst, nav, showNav }
cbk function optional callback
Source:
  • controller.js, line 4377

displayModeler

Load and display the modeler

Parameters:
Name Type Description
ctn string | jquery Container
modelId string model row ID
options object { svg, docked, popup }
Source:
  • controller.js, line 6165

displayMonitoring

Monitoring

Parameters:
Name Type Description
params object Options
Properties
Name Type Description
docked boolean dock monitoring on bottom
tabIndex number tab to focus
cbk function Optional callback
Source:
  • controller.js, line 6085

displayPlaceMap

Placemap service

Parameters:
Name Type Description
ctn string | jquery container to append the map
params object static image { lat, lng, width, height } or dynamic placemap { object, inst, map, nav }
cbk function optional callback when the map is loaded
Source:
  • controller.js, line 6181

displayPreferences

Object preferences

Parameters:
Name Type Description
ctn string | jquery Container
obj string | Simplicite.Ajax.BusinessObject name or Business Object
Source:
  • controller.js, line 5574

displayReferenceList

Display a referenced object (panel list of parent object)

Parameters:
Name Type Description
ctn string | jquery Container
obj string | Simplicite.Ajax.BusinessObject referenced object or name
params Simplicite.UI.Globals.list list options + parent object { name, inst, field, rowId, object }
Source:
  • controller.js, line 3813

displayRow

Build a record of list

Parameters:
Name Type Description
ctn string | jquery container to append the row
obj Simplicite.Ajax.BusinessObject Object
rowId string Object row Id
options Simplicite.UI.Globals.list options to override global row options
cbk function Optional callback to chain something
Source:
  • controller.js, line 3172

displaySearch

Search form

Parameters:
Name Type Description
ctn string | jquery Parent container
obj string | Simplicite.Ajax.BusinessObject name or Business Object
options Simplicite.UI.Globals.search options to override Globals
cbk function Optional callback
Source:
  • controller.js, line 2664

displaySocial

Displays social posts

Parameters:
Name Type Description
ctn string | jquery Container
options object social options
Properties
Name Type Description
object string optional object to limit search
rowId string optional object ID to limit search
activity boolean true to display object activities
onpost function social service(item) to upsert post
ondel function social service(id) to delete post
onlist function social service(page,act) to search posts
onlike function social service(id,like) to (un)like a post
onfollow function follow service
embedded function default false = modal dialog
cbk function optional callback
Source:
  • controller.js, line 5308

displayStatusMetrics

Status metrics

Parameters:
Name Type Description
ctn string | jquery Container
obj string | Simplicite.Ajax.BusinessObject name or Business object
params object Options
Properties
Name Type Description
fromDate string from date search YYYY-MM-DD, default 1 week ago or obj.locals.ui.metrics.fromDate
toDate string to date search YYYY-MM-DD, default today or obj.locals.ui.metrics.toDate
period string group by period: 1=hour, 2=day, 3=week, 4=month, 5=quarter, 6=semester, 7=year / default 2=day or obj.locals.ui.metrics.period
palette string palette name, default sysparam CHART_PALETTE or obj.locals.ui.metrics.palette
cbk function Optional callback
Source:
  • controller.js, line 5993

displaySummary

Object summary

Parameters:
Name Type Description
ctn string | jquery Container
obj string | Simplicite.Ajax.BusinessObject Object
rowId string Object row ID
options object optional parameters
Properties
Name Type Description
inst string optional instance name
icon boolean display the object icon or image thumbnail, default true
image boolean display the object image if any, default true
label string optional label, default: object label
userKey string optional user key, default: object user key
fields Simplicite.Ajax.ObjectField[] optional array of fields to display
onopen function optional handler on open, default: engine.openObject
actions object[] optional array of actions, default row actions
item object optional object values
cbk function Callback to chain
Source:
  • controller.js, line 2505

displaySysInfos

System informations

Parameters:
Name Type Description
ctn string | jquery Container
options object Options { action, objdt, cache }
Source:
  • controller.js, line 5539

displayTemplate

Template editor

Parameters:
Name Type Description
ctn string | jquery Container
rowId string object ID
Source:
  • controller.js, line 6258

displayTray

Trays based on a state model

Parameters:
Name Type Description
ctn string | jquery Container
obj string | Simplicite.Ajax.BusinessObject name or Business object
options object Optional parameters
cbk function Optional callback
Source:
  • controller.js, line 5910

displayTreeView

Display a tree view

Parameters:
Name Type Description
ctn string | jquery optional container
obj Simplicite.Ajax.BusinessObject Root object
rowId string Row ID of the record
name string Treeview name
options object Optional parameters { display, inst, menu, docked, open, addMenu, delMenu, onPage, depth }
cbk function Optional callback
Source:
  • controller.js, line 3554

displayUpdateForm

Build a form for bulk update

Parameters:
Name Type Description
ctn string | jquery Target container
obj string | Simplicite.Ajax.BusinessObject name or Object
options object see Globals.form
cbk function Optional callback
Source:
  • controller.js, line 4882

displayView

Display a view

Parameters:
Name Type Description
ctn string | jquery Container
view string | object View definition or name
options object view options
Properties
Name Type Description
home boolean true on main/domain home view (to get home instance of objects)
parent object when view has a parent object
nav string 'new' or 'add'
showNav boolean true to display the nav
beforeload function optional before load callback
onload function optional onload callback
onunload function optional unload callback
cbk function Optional callback
Source:
  • controller.js, line 1084

displayWorkflow

Workflow wrapper

Parameters:
Name Type Description
ctn string | jquery Container
wkf string | Simplicite.Ajax.BusinessProcess Business process or name
action string start, abort, lock, unlock, validate, cancel, back, list
options object optional activity { step }
cbk function Optional callback
Source:
  • controller.js, line 6118

doAction

Execute one action

Parameters:
Name Type Description
a object Action metadata
obj Simplicite.Ajax.BusinessObject Business object
rowId string Optional object row ID on form/row
Source:
  • controller.js, line 1723

doActionCustom

Execute a custom/backend action (object.action call) after saving the form

Parameters:
Name Type Description
a object Action metadata
obj Simplicite.Ajax.BusinessObject Business object
rowId string Optional object row ID on form/row
values object Optional confirm field values
Source:
  • controller.js, line 1748

doActionGeneric

Execute a generic/UI action (all binded implementations)

Parameters:
Name Type Description
a object Action metadata
obj Simplicite.Ajax.BusinessObject Business object
rowId string Optional object row ID on form/row
Source:
  • controller.js, line 1920

doActionModel

Wrap "open model" actions

Source:
  • controller.js, line 1842

doActionURL

Wrap a backend URL action to front

Parameters:
Name Type Description
a object Action metadata
obj Simplicite.Ajax.BusinessObject Business object
rowId string Optional object row ID on form/row
Source:
  • controller.js, line 1801

findAction

Find an action in plain or plus actions

Parameters:
Name Type Description
o Simplicite.Ajax.BusinessObject Object
name string Action name
list object[] list of actions
plus object[] list of 'plus' actions
Source:
  • controller.js, line 5644

fkCompletion

Foreign-key completion

Parameters:
Name Type Description
ctn jquery Container
obj string | Simplicite.Ajax.BusinessObject) Object
field string | Simplicite.Ajax.ObjectField) Referenced field
index string Optional row index (edit list)
sel function select item callback
disp function display item callback
Source:
  • controller.js, line 5265

getAjax

Current ajax session

Source:
  • controller.js, line 86
Returns:
Simplicite.Ajax instance

getNav

Current navigation

Source:
  • controller.js, line 95
Returns:
Simplicite.UI.Navigator instance

getTop

Top Simplicite window

Source:
  • controller.js, line 6390

getUIAction

Gets the action with UIAction interface

Parameters:
Name Type Description
ctn string | jquery Container
obj Simplicite.Ajax.BusinessObject Object
action object Action metadata or name
Source:
  • controller.js, line 2432

getUIArea

Gets the area with UIArea interface

Parameters:
Name Type Description
ctn string | jquery Container
obj Simplicite.Ajax.BusinessObject Object
area object Area metadata or name or position
Source:
  • controller.js, line 2442

getUIField

Gets the field extended with the UIField interface

Parameters:
Name Type Description
ctn string | jquery Container
obj Simplicite.Ajax.BusinessObject Object
field string | Simplicite.Ajax.ObjectField Object field or name
index string optional for multiple inputs of the same field (edit list)
silent boolean no trace when field is unknown
Source:
  • controller.js, line 2422

getUIObject

Get a business object extended with UI abilities:

  • obj.metadata: object metadata with extended ObjectField
  • obj.ui: this UI engine shorthand
  • obj.locals.ui: copy of global UI options, to be changed per instance
  • optional editors: load Ace and/or Tinymce
  • optional web resources: STYLES and SCRIPT
  • optional UI constraints script

Parameters:
Name Type Description
obj string | Simplicite.Ajax.BusinessObject Object name or BusinessObject
inst string Optional instance name, default is the_ajax_name to be managed as a Main and Ajax object on server side
cbk function Callback function(obj) when loaded
params object Optional parameters to load metadata { context, parent, error }
Source:
  • controller.js, line 2310

getUIView

Gets the view with UIView interface

Parameters:
Name Type Description
ctn string | jquery Container
obj Simplicite.Ajax.BusinessObject optional object
view object View metadata or name
Source:
  • controller.js, line 2452

gotoDefinition

Open one object definition if granted

Parameters:
Name Type Description
name string Object name (Field...)
id string object id
Source:
  • controller.js, line 2476

info

Information dialog box

Parameters:
Name Type Description
msg string content
Source:
  • controller.js, line 1350

isActionBinded

Is action binded ?

Parameters:
Name Type Description
a object action metadata
Source:
  • controller.js, line 1712
Returns:
true if the action is binded

isBinded

Is UI action binded and enabled ?

Parameters:
Name Type Description
name string action name
Source:
  • controller.js, line 1700
Returns:
true if the action is enabled

isMediaDesktop

Is the media a desktop ?

Source:
  • controller.js, line 2239

isMediaMobile

Is the media a mobile ?

Source:
  • controller.js, line 2229

isMediaTablet

Is the media a tablet ?

Source:
  • controller.js, line 2234

linkedLists

Reload the linked lists of an enum field

Parameters:
Name Type Description
ctn string | jquery Container
obj Simplicite.Ajax.BusinessObject Object
field Simplicite.Ajax.ObjectField Enum field
code string Selected value
index string Edit list index
cbk function function(target) to rebuild each target field with the new listOfValues
Source:
  • controller.js, line 5197

loadAceEditor

Load ACE editor

Parameters:
Name Type Description
cbk function optional callback
Source:
  • controller.js, line 373

loadCharts

Load chart.js libs

Source:
  • controller.js, line 5929

loadCSS

Load a server CSS

Parameters:
Name Type Description
p object Parameters
Properties
Name Type Description
url string script location
inline boolean true to inline the styles in header (default add a link to the stylesheet)
async boolean asynchronous ? true by default
onload function optional callback when loaded
silent string true for no logging (not found 404)
force string ignore the local cache
Source:
  • controller.js, line 202

loadDiagramEngine

Load the diagram engine (SVG)

Parameters:
Name Type Description
cbk function Optional callback
Source:
  • controller.js, line 6138

loadEditor

External editor loading

Parameters:
Name Type Description
editor object editor parameters
Properties
Name Type Description
name string unique name
url string URL of editor script
onload function optional handler to init the editor
{function) cbk - callback when loaded
Source:
  • controller.js, line 353

loadEngine

Load the Rendering engine

Parameters:
Name Type Description
name string extension name (ex: bootstrap)
cbk function onload callback
Source:
  • controller.js, line 444

loadPart

Load a HTML/JS/CSS resource in the target selector

Parameters:
Name Type Description
p object Parameters
Properties
Name Type Description
name string resource name
url string or resource URL
type string "HTML", "CSS" or "JS" (or URL extension)
target string optional selector to append the "HTML" part
onload function optional callback when loaded
silent string true for no logging (not found 404)
force string ignore the local cache
Source:
  • controller.js, line 281

loadParts

Load HTML/JS/CSS resources

Parameters:
Name Type Description
list array list of parts [{ name, url, type, target }]
{function) cbk - callback when loaded
Source:
  • controller.js, line 329

loadResource

Load a disposition resource and replace [ROOT] tokens

Parameters:
Name Type Description
p object Parameters
Properties
Name Type Description
url string script location
async boolean asynchronous ? true by default
onload function optional callback when loaded
silent string true for no logging (not found 404)
Source:
  • controller.js, line 247

loadScript

Load a server JavaScript

Parameters:
Name Type Description
p object minimal parameter { url }
Properties
Name Type Description
url string script location
encoding string optional, default 'UTF-8'
async string asynchronous call, true by default
onload string optional callback when loaded
silent string true for no logging (not found 404)
force string ignore the local cache
Source:
  • controller.js, line 135

loadScripts

Load a list of JS scripts (preserve ordering)

Parameters:
Name Type Description
list object[] list of scripts
onload function callback
Source:
  • controller.js, line 176

loadSelectBox

Load the select box component (see https://select2.org)

Parameters:
Name Type Description
cbk function optional callback
Source:
  • controller.js, line 414

loadTinyMCE

Load TinyMCE editor

Parameters:
Name Type Description
cbk function optional callback
Source:
  • controller.js, line 393

loadURL

Load URL in a container: wrap the URL to specific controllers (list, form...) or call the back-end thru ajax

Parameters:
Name Type Description
ctn string | jquery Container
url string URL to load
options object { label, target, nav, showNav }
cbk function Optional callback when loaded
Source:
  • controller.js, line 1379

logout

Default logout: confirm (with text CONFIRM_LOGOUT) and save session

Parameters:
Name Type Description
params object logout parameters
Properties
Name Type Description
confirm boolean true to confirm the logout
url string optional new location URL
legacy boolean true to return to legacy UI
Source:
  • controller.js, line 606

main

Displays all site parts:

  • Create main div
  • load only options.resources if specified
  • load part MAIN/HEADER/FOOTER/MENU/WORK when options.useMainParts=true
  • load STYLES + SCRIPT resources of disposition or object

Parameters:
Name Type Description
cbk function Final callback when displayed
Source:
  • controller.js, line 702

mediaSize

Get the media size

Parameters:
Name Type Description
w number viewport width
Source:
  • controller.js, line 2214
Returns:
media size

onFollow

Follow service wrapper

Parameters:
Name Type Description
method string method name
param string method param
cbk function optional callback
Source:
  • controller.js, line 5508

openObject

Open handler (on a list row or summary): default switch to open object form, reference, doc or image

Parameters:
Name Type Description
ctn string | jquery Container
obj Simplicite.Ajax.BusinessObject Object
rowId string Row ID of the record
params object Optional parameters
Properties
Name Type Description
ref string reference object name
refId string with the reference row ID
field string or the doc/image field name
docId string with document ID
imageId string or image ID
Source:
  • controller.js, line 3661

openURL

Open the URL in a new window

Parameters:
Name Type Description
url string URL to open
target string optional, default '_blank'
Source:
  • controller.js, line 1360

populateReference

Populate the referenced fields

Parameters:
Name Type Description
ctn string | jquery Container
obj Simplicite.Ajax.BusinessObject Object
refField string Foreign key field
refId string Reference row ID, or null to reset referenced fields
index string Optional row index (edit list)
cbk function optional callback
Source:
  • controller.js, line 3957

previewDocument

Preview a document: default open a dialog with the preview

Parameters:
Name Type Description
doc object document data
Properties
Name Type Description
object object object name
field object doc field name
rowId object row ID
docId object document ID
name object document name
embedded boolean embedded or dialog
Source:
  • controller.js, line 4416

randomString

Random string

Parameters:
Name Type Description
len Length
Source:
  • controller.js, line 115
Returns:
Random string of specified length

readField

Read the form field into object field (async/file reading)

Parameters:
Name Type Description
ctn string | jquery Container to find field
obj Simplicite.Ajax.BusinessObject optional business object
f Simplicite.Ajax.ObjectField Business field
index string Optional index of field (list edit)
cbk function Callback when readed
Source:
  • controller.js, line 5664

readFile

Read a form input file

Parameters:
Name Type Description
file object input file (jQuery or DOM object)
cbk function required callback
Source:
  • controller.js, line 5725

readForm

Read all form fields into object fields (async/file reading)

Parameters:
Name Type Description
ctn string | jquery Container to find fields
obj Simplicite.Ajax.BusinessObject Business object
index string Optional index (list edit)
cbk function Callback
Source:
  • controller.js, line 5707

ready

When page is loaded: load user rights, menu, texts and engine.
Then call the main page service.

Parameters:
Name Type Description
app Simplicite.Ajax Ajax API to access to data
engine string extension name (default 'bootstrap')
options Simplicite.UI.Globals some globals options to override
cbk function Optional callback when loaded
Source:
  • controller.js, line 567

resize

Resize window handler

Parameters:
Name Type Description
force boolean true to force a full redraw
Source:
  • controller.js, line 2252

saveForm

Save the object form

Parameters:
Name Type Description
ctn jquery Container
obj Simplicite.Ajax.BusinessObject Business object
cbk function Callback function(obj, errors, messages)
Source:
  • controller.js, line 5761

saveList

Save the object list

Parameters:
Name Type Description
ctn jquery Container
obj Simplicite.Ajax.BusinessObject Business object
cbk function Callback(obj, errRow, msgRow)
Source:
  • controller.js, line 5784

saveObject

Save the object after reading UI values

Parameters:
Name Type Description
ctn jquery Container
obj Simplicite.Ajax.BusinessObject Business object
index string Optional index/rowId in list
onSuccess function Callback(msgs) on success
onError function Callback(errs) on error
Source:
  • controller.js, line 5841

saveSession

Save the session (by default the recent activity in HISTORY)

Parameters:
Name Type Description
cbk function optional callback
Source:
  • controller.js, line 632

selectDatamap

Object datamap picker: default open a popup to select data

Parameters:
Name Type Description
ctn string | jquery Parent container of referenced fields to set
obj Simplicite.Ajax.BusinessObject Object
field Simplicite.Ajax.ObjectField Mapped field
index string Optional row index (edit list)
Source:
  • controller.js, line 4096

selectMetaObject

Meta-object picker: default open a popup to select a reference

Parameters:
Name Type Description
ctn string | jquery Parent container of referenced fields to set
obj string | Simplicite.Ajax.BusinessObject Object
field string | Simplicite.Ajax.ObjectField Field of meta-object to select
index string Optional row index (edit list)
Source:
  • controller.js, line 4052

selectObject

Object picker: default open a popup to select object(s) (used by modeler and associate)

Parameters:
Name Type Description
ctn string | jquery Parent container
obj string | Simplicite.Ajax.BusinessObject object name or business object
options object list additive options { filters, minified, layout... } and selectRows for multiple selections
cbk function callback(obj, id or array of ids) called on selection
Source:
  • controller.js, line 3708

selectReference

Object reference picker: default open a popup to select a reference

Parameters:
Name Type Description
ctn string | jquery Parent container of referenced fields to set
obj Simplicite.Ajax.BusinessObject Object
ref string | Simplicite.Ajax.BusinessObject Referenced object name or business object (list popup)
refField string | Simplicite.Ajax.ObjectField Foreign key (or meta object) field to select (name or field)
index string Optional row index (edit list)
Source:
  • controller.js, line 3857

session

Open the user session with authtoken

Parameters:
Name Type Description
cbk function callback when the session is opened or not
Source:
  • controller.js, line 533

setAjax

Set the Ajax APIs

Parameters:
Name Type Description
ajax Simplicite.Ajax Simplicite.Ajax instance
Source:
  • controller.js, line 50

setCompletionSize

Completion minimum size to trigger the search. 0 = disable

Parameters:
Name Type Description
size number positive number
Source:
  • controller.js, line 5229

setEngineView

Set the view engine

Parameters:
Name Type Description
name string extension name (ex: bootstrap)
cbk function onload callback
Source:
  • controller.js, line 518

setTheme

Change the current CSS theme (stored in local storage)

Parameters:
Name Type Description
theme string theme name (ex: 'default', 'light', 'dark')
cbk function optional callback
Source:
  • controller.js, line 828

title

Object title to display.

Parameters:
Name Type Description
obj Simplicite.Ajax.BusinessObject Object with metadata (label, plurallabel, userkey)
userKey boolean true to add the valued user-key
plural boolean true to use the plural label if exists
Source:
  • controller.js, line 2463

toast

Toast dialog box

Parameters:
Name Type Description
params string | object message or object with:
Properties
Name Type Description
type string optional 'error|danger|warning|info'
content string | jQuery toast body
position string top|bottom
align string left|right|center
undo boolean add a Undo button ?
Source:
  • controller.js, line 1216

unbind

Unbind one UI action

Parameters:
Name Type Description
name string action name
Source:
  • controller.js, line 1690

undoRedo

Undo/Redo service

Parameters:
Name Type Description
ctn string | jquery Target container
action string undo|redo
num string number of iterations (default 1)
Source:
  • controller.js, line 4480

yesNo

Yes/No dialog box

Parameters:
Name Type Description
params string | object message or object with:
Properties
Name Type Description
name string optional name
title string optional title, default "CONFIRM"
content string | jQuery optional alert body
help string | jQuery optional help
onYes function optional callback on "YES" button
onNo function optional callback on "NO" button
dontAskAgain string use the 'dont't ask again' local storage (true=keep user's action or string=forced response), needs a name
Source:
  • controller.js, line 1274

yesNoCancel

Yes/No/Cancel dialog box

Parameters:
Name Type Description
params string | object message or object with:
Properties
Name Type Description
name string optional name
title string optional title, default "CONFIRM"
content string | jQuery optional alert body
help string | jQuery optional help
onYes function optional callback on "YES" button
onNo function optional callback on "NO" button
onCancel function optional callback on "CANCEL" button
dontAskAgain string use the 'dont't ask again' local storage (true=keep user's action or string=forced response), needs a name
Source:
  • controller.js, line 1314

<inner> keydown

Default keydown handler : CTRL-S and ESCAPE

Source:
  • controller.js, line 800