Namespace mmir.PresentationManager
Defined in: presentationManager.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Field Attributes | Field Name and Description |
|---|---|
|
Counter that keeps track of the number of times, that a view is rendered
NOTE: for implementation specific reasons, jQuery Mobile requires that
each page has a different ID.
|
|
| <constant> |
| Method Attributes | Method Name and Description |
|---|---|
|
addPartial(ctrlName, partial)
|
|
|
addView(ctrlName, view)
|
|
|
callRenderEngine(funcName, args)
This function allows to call custom functions of the rendering-engine
that was set via #setRenderEngine.
|
|
|
getLayout(layoutName, doUseDefaultIfMissing)
This function returns a layout object by name.
|
|
|
getPartial(controllerName, viewName)
This function returns a partial object by name.
|
|
|
getView(controllerName, viewName)
This function returns a view object by name.
|
|
|
Closes a modal window / dialog (if one is open).
|
|
|
Hides / closes the "wait" dialog.
|
|
|
init()
|
|
|
Renders the previous view again, using the
mmir.DialogManager#render method.
|
|
|
renderView(ctrlName, viewName, data)
Gets the view for a controller, then executes helper methods on
the view data.
|
|
|
Renders the current view again, using the
#renderView method.
|
|
|
setRenderEngine(theRenderEngine)
Sets the rendering engine for the views.
|
|
|
showDialog(ctrlName, dialogId, data)
Opens the dialog for ID
dialogId. |
|
|
showWaitDialog(text, data)
Shows a "wait" dialog, i.e.
|
Namespace Detail
mmir.PresentationManager
- Requires:
- document (DOM object)
- jQuery.Deferred
- jQuery.ajax
- jQuery.each
Field Detail
{Integer}
_pageIndex
Counter that keeps track of the number of times, that a view is rendered
NOTE: for implementation specific reasons, jQuery Mobile requires that
each page has a different ID. This pageIndex is used to generating
such a unique ID, by increasing the number on each page-change
(i.e. by rendering a view) and appending it to the page's ID/name.
<constant>
{Integer}
pageIndex
Method Detail
addPartial(ctrlName, partial)
- Parameters:
- {String|Controller} ctrlName
- {String|Partial} partial
addView(ctrlName, view)
- Parameters:
- {String|Controller} ctrlName
- {String|View} view
callRenderEngine(funcName, args)
This function allows to call custom functions of the rendering-engine
that was set via #setRenderEngine.
IMPORTANT:
note that the function will be invoked in context of rendering-engine
(i.e.
NOTE that calling non-existing functions on the rendering-engine will cause an error.
this references will refer to rendering-engine
and not to the PresentationManager instance.
For example, when mmir.PresentationManager.callRenderEngine('hideWaitDialog')
is called, any this references within the hideWaitDialog
implementation would refer to object, that was set in setRenderEngine(object).
In comparison, when called as mmir.PresentationManager.hideWaitDialog() the
this references refer to the mmir.PresentationManager instance.
NOTE that calling non-existing functions on the rendering-engine will cause an error.
- Parameters:
- {String} funcName
- the name of the function, that should be invoked on the rendering engine.
-
{Array
} args Optional - OPTIONAL
the arguments for
funcNameinvoked viaFunction.apply(renderingEngine, args), e.g. forargs = [param1, param2, param3]the function will be called withfuncName(param1, param2, param3)(note that the function receives 3 arguments, and not 1 Array-argument).
getInstance()
- Deprecated:
- instead: use mmir.PresentationManager directly
{Object}
getLayout(layoutName, doUseDefaultIfMissing)
This function returns a layout object by name.
- Parameters:
- {String} layoutName
- Name of the layout which should be returned
- {Boolean} doUseDefaultIfMissing Optional
- if supplied and
true, the default controller's layout will be used as a fallback, in case no corresponding layout could be found
- Returns:
- {Object} The requested layout, "false" if not found
{Object}
getPartial(controllerName, viewName)
This function returns a partial object by name.
- Parameters:
- {String} controllerName
- Name of the controller for the view
- {String} viewName
- Name of the partial which should be returned
- Returns:
- {Object} The requested partial, "false" if not found
{Object}
getView(controllerName, viewName)
This function returns a view object by name.
- Parameters:
- {String} controllerName
- Name of the controller for the view
- {String} viewName
- Name of the view which should be returned
- Returns:
- {Object} The requested view, false if not found
hideCurrentDialog()
Closes a modal window / dialog (if one is open).
hideWaitDialog()
Hides / closes the "wait" dialog.
init()
renderPreviousView()
Renders the previous view again, using the
mmir.DialogManager#render method.
- Deprecated:
- you should use #renderView with appropriate parameters instead.
- Requires:
- mmir.DialogManager
renderView(ctrlName, viewName, data)
Gets the view for a controller, then executes helper methods on
the view data. The Rendering of the view is done by the
#doRenderView method. Also
stores the previous and current view with parameters.
- Parameters:
- {String} ctrlName
- Name of the controller
- {String} viewName
- Name of the view to render
- {Object} data Optional
- optional data for the view.
Currently same jQuery Mobile specific properties are supported:
When these are present, they will be used for animating the page transition upon rendering.{transition: STRING, reverse: BOOLEAN}where
transition: the name for the transition (see jQuery Mobile Doc for possible values) DEFAULT: "none".reverse: whether the animation should in "forward" (FALSE) direction, or "backwards" (TRUE) DEFAULT: FALSE
reRenderView()
Renders the current view again, using the
#renderView method.
- Deprecated:
- you should use #renderView with appropriate parameters instead.
- Requires:
- mmir.DialogManager
setRenderEngine(theRenderEngine)
Sets the rendering engine for the views.
The render engine must implement a function render
and may implement functions showDialog,
hideCurrentDialog, showWaitDialog, and hideWaitDialog:
By default, the rendering-engine as defined by the module ID/path in
The implementation of the default view-engine is at
- theRenderEngine.
render(ctrlName : String, viewName : String, view : View, ctrl : Controller, data : Object) : void - theRenderEngine.
showDialog(ctrlName : String, dialogId : String, data : Object) : Dialog - theRenderEngine.
hideCurrentDialog(): void - theRenderEngine.
showWaitDialog(text : String, data : Object): void - theRenderEngine.
hideWaitDialog(): void
theRenderEngine will be called in
context of the PresentationManager.
Custom functions of the specific rendering engine implementation
(i.e. non-standard functions) can be call via #callRenderEngine.
By default, the rendering-engine as defined by the module ID/path in
core.viewEngine will be loaded and set during initialization
of the DialogManager.
The implementation of the default view-engine is at
mmirf/env/view/presentation/jqmViewEngine.js.
- Parameters:
- {Object} theRenderEngine
- the render-engine for views
- See:
- mmir.PresentationManager#renderView
- mmir.PresentationManager#showDialog
- mmir.PresentationManager#hideCurrentDialog
- mmir.PresentationManager#showWaitDialog
- mmir.PresentationManager#hideWaitDialog
- mmir.PresentationManager#callRenderEngine
{Object}
showDialog(ctrlName, dialogId, data)
Opens the dialog for ID
dialogId.
- Parameters:
- {String} ctrlName
- the Name of the controller
- {String} dialogId
- the ID of the dialog
- {Object} data Optional
- OPTIONAL a data / options object
- Returns:
- {Object} the instance of the opened dialog (void or falsy dialog was not opened)
showWaitDialog(text, data)
Shows a "wait" dialog, i.e. "work in progress" notification.
- Parameters:
- {String} text Optional
- OPTIONAL
the text that should be displayed.
If omitted the language setting for
loadingTextwill be used instead (from dictionary.json) - {Object} data Optional
- OPTIONAL a data / options object