AMI Web Framework API > Class > SubApp


ami.SubApp

The basic AMI sub-application
Implements: ami.ISubApp

Constructor


SubApp()

Methods


onReady(userdatanull) ->{$.Promise or $.Deferred or undefined}
Called when the sub-application is ready to run

Parameters:
NameTypeDescriptionDefaultOptionalNullable
userdata*the user data
Returns:
A JQuery promise object, deferred object or nothing
Type: $.Promise or $.Deferred or undefined

onExit(userdatanull) ->{$.Promise or $.Deferred or undefined}
Called when the sub-application is about to exit

Parameters:
NameTypeDescriptionDefaultOptionalNullable
userdata*the user data
Returns:
A JQuery promise object, deferred object or nothing
Type: $.Promise or $.Deferred or undefined

onLogin(userdatanull) ->{$.Promise or $.Deferred or undefined}
Called when logging in

Parameters:
NameTypeDescriptionDefaultOptionalNullable
userdata*the user data
Returns:
A JQuery promise object, deferred object or nothing
Type: $.Promise or $.Deferred or undefined

onLogout(userdatanull) ->{$.Promise or $.Deferred or undefined}
Called when logging out

Parameters:
NameTypeDescriptionDefaultOptionalNullable
userdata*the user data
Returns:
A JQuery promise object, deferred object or nothing
Type: $.Promise or $.Deferred or undefined

setupCtx(immutables, defaults, options) ->{Object.<string, *>}
Sets up the application's context

Parameters:
NameTypeDescriptionDefaultOptionalNullable
immutablesObject.<string, *>dictionary of immutable parameters in the application's context
defaultsObject.<string, *>dictionary of default values for optional parameters
optionsObject.<string, *>dictionary of values for optional parameters
Returns:
The resulting application's context
Type: Object.<string, *>

createControl(parentnull, control, params, options) ->{$.Promise}
Asynchronously creates a control

Parameters:
NameTypeDescriptionDefaultOptionalNullable
parent*the parent entity
controlstringthe control name
paramsArray.<*>the control's parameters
optionsObject.<string, *>dictionary of optional parameters (context, cache){}
Returns:
A JQuery promise object
Type: $.Promise

createControlInBody(parentnull, control, controlParams, controlOptions, options) ->{$.Promise}
Asynchronously creates a control in the body

Parameters:
NameTypeDescriptionDefaultOptionalNullable
parent*the parent entity
controlstringthe control name
controlParamsArray.<*>the control's render method mandatory parameters
controlOptionsObject.<string, *>the control's render method optional parameters
optionsObject.<string, *>dictionary of optional parameters (context, cache){}
Returns:
A JQuery promise object
Type: $.Promise

createControlInContainer(parentnull, control, controlParams, controlOptions, icon, title, options) ->{$.Promise}
Asynchronously creates a control in a container

Parameters:
NameTypeDescriptionDefaultOptionalNullable
parent*the parent entity
controlstringthe control name
controlParamsArray.<*>the control's render method mandatory parameters
controlOptionsObject.<string, *>the control's render method optional parameters
iconstringthe icon
titlestringthe title
optionsObject.<string, *>dictionary of optional parameters (context, cache){}
Returns:
A JQuery promise object
Type: $.Promise

createControlFromWebLink(parentnull, el, options) ->{$.Promise}
Asynchronously creates a control in a container from a WEB link

Parameters:
NameTypeDescriptionDefaultOptionalNullable
parent*the parent entity
elElementthe HTML element
optionsObject.<string, *>dictionary of optional parameters (context, cache){}
Returns:
A JQuery promise object
Type: $.Promise