Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.servlet.event
Class GoEventHandler

java.lang.Object
  |
  +--oracle.cabo.servlet.event.GoEventHandler
All Implemented Interfaces:
EventHandler

public class GoEventHandler
extends java.lang.Object
implements EventHandler

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

GoEventHandler

public GoEventHandler()
Creates a GoEventHandler.
Method Detail

getName

public java.lang.String getName()
Gets the page name that this event handler will redirect to.

setName

public void setName(java.lang.String name)
Sets the page name that this event handler will redirect to.

isRedirect

public boolean isRedirect()
Returns whether a client-side redirect will be used.

setRedirect

public void setRedirect(boolean redirect)
Sets whether a client-side redirect will be used.

addProperty

public void addProperty(java.lang.String propertyName,
                        java.lang.String keyValue)
Adds a static page property.
Parameters:
propertyName - the name of the page property
keyValue - the fixed value of the page property

addParameterProperty

public void addParameterProperty(java.lang.String propertyName,
                                 java.lang.String parameterName)
Adds a page property derived from an event parameter.
Parameters:
propertyName - the name of the page property
parameterName - the name of the event parameter to copy as a page property.

addSelectionProperty

public 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. The page property can be the selection index itself, or a value on the selected row.

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.

Parameters:
propertyName - the name of the page property
selectionName - 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.

handleEvent

public EventResult handleEvent(BajaContext context,
                               Page page,
                               PageEvent event)
Handles the event by going to the target page.
Specified by:
handleEvent in interface EventHandler
Following copied from interface: oracle.cabo.servlet.event.EventHandler
Parameters:
context - the BajaContext
page - the page the client is requesting
event - the event on that page, or null if the client is just requesting a page display
Returns:
an object encapsulating results of this event
Throws:
java.lang.Throwable - if any processing of the event fails

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.