|
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.ui.action.ClientAction
The ClientAction object is used to associate client-side behavior with a UINode. The ClientAction is responsible for providing a script which can be called in response to user interaction on the client. The actual user action that results in the execution of the ClientAction's script varies from component to component. For example, the ClientAction's script might be executed in response to clicking on a link or button or selecting an item from a choice.
Constructor Summary | |
ClientAction()
|
Method Summary | |
Parameter[] |
getParameters(RenderingContext context,
UINode node)
Returns an array of all parameters to this ClientAction. |
abstract java.lang.String |
getScript(RenderingContext context,
UINode node,
java.lang.Boolean returnVal)
Returns the script which implements this ClientAction. |
boolean |
isTriggerRequired(RenderingContext context,
UINode node)
Tests whether the ClientAction should be invoked using an explicit trigger such as a button or link. |
boolean |
renderAsEvent(RenderingContext context,
UINode node)
Returns true if it's OK to render this ClientAction's script as an event (e.g. |
void |
renderTrigger(RenderingContext context,
UINode node)
Renders a trigger (a link or button) which can be used to invoke the ClientAction. |
void |
renderTrigger(RenderingContext context,
UINode node,
java.lang.Object text)
Renders a trigger (a link or button) which can be used to invoke the ClientAction. |
void |
writeDependencies(RenderingContext context,
UINode node)
Called by the UIX Component rendering engine before getScript
in order to give the ClientAction the opportunity to generate
its client-side dependencies before getScript
and in a more suitable output scope. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ClientAction()
Method Detail |
public abstract java.lang.String getScript(RenderingContext context, UINode node, java.lang.Boolean returnVal)
context
- The current RenderingContext.node
- The target UINode.returnVal
- Determines whether the final script will return.
true or false.public void writeDependencies(RenderingContext context, UINode node) throws java.io.IOException
getScript
in order to give the ClientAction the opportunity to generate
its client-side dependencies before getScript
and in a more suitable output scope.context
- The current RenderingContext.node
- The target UINode.public boolean isTriggerRequired(RenderingContext context, UINode node)
In general, ClientActions are executed in response to user interaction
with an input control, such as selecting an item from a choice component
or radio button group, or tabbing out of a text input component. In some
cases the ClientAction may provide a script which should not be fired in
response to the normal user input, but instead should only be executed in
response to an explicit request from the end user. For example, the
partial page rendering ClientActions revert to full page rendering in
environments where partial page rendering is not supported (such as
Netscape 4.x). However, performing a full page render in response to user
interaction such as tabbing out of a text input component would be
confusing to the end user. Instead, the isTriggerRequired()
method can be used to indicate that an explicit
trigger, such as a "Go" button, should be used to invoke the action.
Components which support ClientActions should call this method before
calling getScript()
to determine whether or not an
explicit trigger is required. If isTriggerRequired()
returns true, renderTrigger()
should be called to render content which includes a trigger (a link or
button) which invokes the action.
Components which are themselves explict triggers (link or button
components) may call getScript()
instead of renderTrigger()
even if isTriggerRequired()
returns true. In some cases the ClientAction
implementation may be able to provide a script which can be invoked by
link/button components, in which case an auxiliary trigger is not
necessary.
context
- The current RenderingContext.node
- The target UINode.renderTrigger()
public void renderTrigger(RenderingContext context, UINode node) throws java.io.IOException
This method should be called by components which support ClientActions
when isTriggerRequired()
returns true. It is up
to each component to determine when/where the trigger should be rendered.
For example, a choice component might render the trigger next to the
choice, whereas a radio group would probably render the trigger beneath
all of the radio buttons in the group.
This method renders a button with the text "GO". Use the three argument
method to specify alternate button text.
context
- The current RenderingContext.node
- The target UINode.isTriggerRequired()
public void renderTrigger(RenderingContext context, UINode node, java.lang.Object text) throws java.io.IOException
This method should be called by components which support ClientActions
when isTriggerRequired()
returns true. It is up
to each component to determine when/where the trigger should be rendered.
For example, a choice component might render the trigger next to the
choice, whereas a radio group would probably render the trigger beneath
all of the radio buttons in the group.
This method renders a button with the given text.
context
- The current RenderingContext.node
- The target UINode.isTriggerRequired()
public Parameter[] getParameters(RenderingContext context, UINode node)
context
- The current RenderingContext.node
- The target UINode.public boolean renderAsEvent(RenderingContext context, UINode node)
getParameters()
method, and other information on the parent node. As an
example, the LinkRenderer
might render an onClick script in the case of a
formSubmitted Action, but it can render a simple href if there is nothing
special to be done.context
- The current RenderingContext.node
- The target UINode.getParameters()
|
UIX 2.2.16 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |