|
UIX 2.2.16 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.cabo.servlet.event.mobile.PickerEventHandler
A lov in mobile does not pop up a javascript window, instead it fires an event back to the server.
A lovField on a pda sends
event='lov'
type='pre'
source=id(or name if no id) of lovField
uri=value of destination attribute
This sets up the user to be able to navigate to a new page, pick a value, and navigate back to the original page. PickerEventHandler can be used to help the user with that and save state during the process. The class name starts with the word "picker" because it can be used with events fired by components like a dateField or lovField where a user navigates off the page to pick a value, and then the value picked is shown on the original page. This should be done without losing other state as they navigate to/from the "pick" page.
Below is a brief description of the following methods in oracle.cabo.servlet.event.mobile.PickerEventHandler:
handleEvent()
handleCancel()
handlePreType()
handlePostType()
saveState()
restoreState()
- handleEvent() looks at the event name and calls handleCancel() if the
event name is 'cancel', otherwise it looks for an event parameter
named 'type' and calls handlePreType() if the 'type' is 'pre',
or handlePostType() if the 'type' is 'post'.
- handlePreType() should be called on the request from the original
page to the "pick" page. The default version returns the original page.
It is expected that the user will override this method to call
saveState(). The user can then redirect to the value in the 'uri' parameter.
- handlePostType() should be called on the way from the "pick"
page back to the original page. The default version returns
the original page. It is expected that the user will override
this method and call restoreState().
- saveState() saves the state and returns a token which will be
passed to restoreState(). The token can be passed to and returned
from the "pick" page to use when restoreState() is called.
In the default implementation the PageEvent object is saved on the session.
- restoreState() restores the state based on the token passed in.
In the default implementation the parameter names and values from
the pageEvent object stored on the session are set on the eventResult,
except a new value is set for the element that originally fired the event.
Field Summary | |
static java.lang.String |
TOK_NAME
The name of the token used. |
static java.lang.String |
TOK_PARAM
|
Constructor Summary | |
PickerEventHandler()
|
Method Summary | |
static EventHandler |
getEventHandler()
|
static java.util.Dictionary |
getParameterMap(PageEvent event)
Returns a Dictionary that maps parameter keys to values. |
protected EventResult |
handleCancel(BajaContext context,
Page page,
PageEvent event)
Restore the original state. |
EventResult |
handleEvent(BajaContext context,
Page page,
PageEvent event)
Decide which handle method to call. |
protected EventResult |
handlePostType(BajaContext context,
Page page,
PageEvent event)
Returns original page. |
protected EventResult |
handlePreType(BajaContext context,
Page page,
PageEvent event)
Returns original page by default. |
protected void |
restoreState(BajaContext context,
Page page,
PageEvent event,
EventResult result,
java.lang.String token)
Restore the state. |
protected void |
restoreState(BajaContext context,
Page page,
PageEvent event,
EventResult result,
java.lang.String token,
java.lang.Object value)
Given the token, restore the state. |
protected java.lang.String |
saveState(BajaContext context,
Page page,
PageEvent event)
Save the state and return a token representing the state which will be returned to the user in the restoreState method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String TOK_NAME
public static final java.lang.String TOK_PARAM
Constructor Detail |
public PickerEventHandler()
Method Detail |
public EventResult handleEvent(BajaContext context, Page page, PageEvent event) throws java.io.IOException
handleEvent
in interface EventHandler
oracle.cabo.servlet.event.EventHandler
context
- the BajaContextpage
- the page the client is requestingevent
- the event on that page, or null if the client
is just requesting a page displayjava.lang.Throwable
- if any processing of the event failsprotected EventResult handlePreType(BajaContext context, Page page, PageEvent event) throws java.io.IOException
protected EventResult handlePostType(BajaContext context, Page page, PageEvent event) throws java.io.IOException
protected java.lang.String saveState(BajaContext context, Page page, PageEvent event)
In this implementation the PageEvent object is saved on the session. The token returned is TOKEN_NAME
protected void restoreState(BajaContext context, Page page, PageEvent event, EventResult result, java.lang.String token, java.lang.Object value)
In this implementation the parameter names and values from the pageEvent object stored on the session are set on the eventResult, except a new value is set for the element that originally fired the event.
protected EventResult handleCancel(BajaContext context, Page page, PageEvent event) throws java.io.IOException
protected void restoreState(BajaContext context, Page page, PageEvent event, EventResult result, java.lang.String token)
Calls restoreState(context, page, event, result, token, null);
public static java.util.Dictionary getParameterMap(PageEvent event)
event
- the PageEvent object to pull parameters off ofpublic static EventHandler getEventHandler()
|
UIX 2.2.16 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |