This section includes the application, stage, and scene controller methods used in the book. These are just a subset of the APIs available; refer to the Palm SDK for a complete list of the available APIs.
Each entry includes a very brief description, followed by an enumeration of the arguments used in the method call.
Method to create a new stage and be called back when the stage is loaded.
Returns | Type | Description |
---|---|---|
None |
Function to get a controller or proxy object for a stage. Returns the stage controller if
available, but if the stage is still in the process of being created, a
proxy object will be returned instead. This proxy implements delegateToSceneAssistant()
, and will delegate
the calls as expected when the stage is available.
Sends the passed-in notification data to everyone in the commander stack of the focused
window (usually the scene assistant, stage assistant, and application
assistant), calling considerForNotification()
, if present, on
each.
Shows the message text from the bannerParams
in the
banner area. The launchArguments
will be used to launch or
relaunch the application if the banner is touched.
Returns | Type | Description |
---|---|---|
None |
Wrapper around Mojo.Event.listen
that
additionally will call get()
on the
element parameter if it is a string, converting it to a DOM node.
Returns | Type | Description |
---|---|---|
None |
If the elementId
is a string,
calls document.getElementById()
with
that string and returns the result. Otherwise, it returns elementId
.
Removes a request from the scene’s list of requests to manage; once a scene is popped this will no longer clear the request.
Creates a Palm service request that will be automatically cancelled when
the scene is popped. The parameters are passed directly to new Mojo.Service.Request()
.
Returns | Type | Description |
---|---|---|
request | Object | A request object, important for requests that persist beyond scene’s life or to be able to remove the request |
Registers the given attributes and model to be used with the widget of the given name. Called by scene assistants in their setup methods.
Wrapper around Mojo.Event.stopListening
that additionally
will call get()
on the element
parameter if it is a string, converting it to a DOM node.
Returns | Type | Description |
---|---|---|
None |
Activates this stage, similar to window.focus()
. Causes card windows to be
maximized.
Arguments | Type | Description |
---|---|---|
None |
Returns | Type | Description |
---|---|---|
None |
Returns the currently active scene from this stage, if any. If no scenes are active, it returns undefined.
Deactivates this stage. Causes card windows to be minimized.
Arguments | Type | Description |
---|---|---|
None |
Returns | Type | Description |
---|---|---|
None |
Use to call a method on the assistant of the current scene of this stage. The
first parameter is the name of the property that contains the function
to call. The remaining parameters are passed to that function. The
this
keyword is bound to the scene assistant for this
call; any additional arguments will be passed to the scene assistant’s
method.
Removes a scene from the scene stack, passing the return value to the
newly revealed scene’s activate
method. Note that this is an asynchronous operation. Any additional
arguments are also passed to the new scene.
Removes scenes from the scene stack until the target scene is reached, or
no scenes remain on the stack. targetScene
may be either the SceneController
for the desired scene, the
scene DOM ID, or the scene name. If targetScene
is undefined, all scenes will be
popped. Intermediate popped scenes are not reactivated, nor is there any
visual transition to signify their removal from the stack. This is an
asynchronous operation.
Pushes a new scene; the Scene Lifecycle initial setup includes this function. This is an asynchronous operation.
3.135.221.112