|
Oracle UIX API Reference Release 2.1.22.0.0 B12196-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.cabo.servlet.event.GoEventHandler
An EventHandler
that supports explicitly going to a
named page, and adding page properties either statically or
dynamically based on values in the PageEvent
.
By default, it will use a server-side redirect to the page - which
does not require a round-trip to the client, and preserves all
event handler state - but it can also use a client-side redirect.
A client-side redirect will drop all state generated by the
event handling phase, as well as the PageEvent
itself.
This may or may not be a good thing! It will also be somewhat
slower, because it triggers a full roundtrip to and from the client.
However, client-side redirects will result in a more natural
URL (better for bookmarking) and allows the "null" event handler
to be fired on the target page.
Constructor Summary | |
GoEventHandler()
Creates a GoEventHandler. |
Method Summary | |
void |
addParameterProperty(java.lang.String propertyName,
java.lang.String parameterName)
Adds a page property derived from an event parameter. |
void |
addProperty(java.lang.String propertyName,
java.lang.String keyValue)
Adds a static page property. |
void |
addSelectionProperty(java.lang.String propertyName,
java.lang.String selectionName,
java.lang.String parameterKey)
Adds a page property derived from a UI selection, especially a UIX Components table. |
java.lang.String |
getName()
Gets the page name that this event handler will redirect to. |
EventResult |
handleEvent(BajaContext context,
Page page,
PageEvent event)
Handles the event by going to the target page. |
boolean |
isRedirect()
Returns whether a client-side redirect will be used. |
void |
setName(java.lang.String name)
Sets the page name that this event handler will redirect to. |
void |
setRedirect(boolean redirect)
Sets whether a client-side redirect will be used. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GoEventHandler()
Method Detail |
public java.lang.String getName()
public void setName(java.lang.String name)
public boolean isRedirect()
public void setRedirect(boolean redirect)
public void addProperty(java.lang.String propertyName, java.lang.String keyValue)
propertyName
- the name of the page propertykeyValue
- the fixed value of the page propertypublic void addParameterProperty(java.lang.String propertyName, java.lang.String parameterName)
propertyName
- the name of the page propertyparameterName
- the name of the event parameter to copy
as a page property.public void addSelectionProperty(java.lang.String propertyName, java.lang.String selectionName, java.lang.String parameterKey)
For example, consider the following UIX table:
<table name="thisTable"> <tableSelection> <singleSelection/> </tableSelection> <contents> ... <formValue name="rowID" data:value="..."/> </contents> </table>
This generates a selectable table where each row contains a "rowID" value. The following code will automatically pass the rowID of the selected row as a page property named "row":
GoEventHandler go = ...; go.addSelectionProperty("row", "thisTable", "rowID");
If the parameter key is null
, then the selected
index itself will be passed.
propertyName
- the name of the page propertyselectionName
- the name of the UI component (generally a table name)parameterKey
- the key of the per-row parameter to use. If
null, the selection index itself will be passed.public EventResult handleEvent(BajaContext context, Page page, PageEvent event)
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 fails
|
Oracle UIX API Reference Release 2.1.22.0.0 B12196-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |