org.apache.myfaces.trinidadinternal.ui.action
Class FireAction

java.lang.Object
  extended by org.apache.myfaces.trinidadinternal.ui.action.ClientAction
      extended by org.apache.myfaces.trinidadinternal.ui.action.FireAction
Direct Known Subclasses:
FirePartialAction

public class FireAction
extends ClientAction

ClientAction implementation which fires or submits an event which can be used to re-render dependent components. When the FireAction is triggered, an "update" event is sent to the application. The event may specify the following event parameters:

The event will be sent either with a form submit or a page redraw. The submit action is provided as a substitute for the JavaScript submitForm() API to allow clients to trigger form submission without having to write JavaScript code. A submitted FormAction always submits the form which contains the UINode that triggers the action. Clients may optionally specifiy whether the form should be submitted without validation, as well as additional parameters to submit with the form.

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/ui/action/FireAction.java#0 $) $Date: 10-nov-2005.18:57:43 $
Author:
The Oracle ADF Faces Team

Field Summary
protected static java.lang.String _BLOCK_SCRIPT
           
protected static java.lang.String _SUBMIT_START
           
protected static java.lang.String FULL_END_SCRIPT
           
protected static java.lang.String FULL_START_SCRIPT
           
 
Constructor Summary
FireAction()
          Creates a FireAction which will fire an update event by submiting the enclosing form.
FireAction(java.lang.String event)
          Creates a FireAction which will submit the enclosing form with the specified event name.
FireAction(java.lang.String event, boolean submit)
          Creates a FireAction with the specified event name.
 
Method Summary
protected static void appendClientParameters(UIXRenderingContext context, java.lang.StringBuffer buffer, Parameter[] parameters)
           
protected static void appendJSParameter(java.lang.StringBuffer buffer, java.lang.String value)
           
protected static void appendURLParameter(java.lang.StringBuffer buffer, java.lang.String name, java.lang.String value)
           
protected static int getBufferSize(UIXRenderingContext context, java.lang.String startScript, java.lang.String endScript, java.lang.String destination, java.lang.String formName, java.lang.String event, java.lang.String source, java.lang.String partialTargets, java.lang.String eventKey, java.lang.String sourceKey, java.lang.String partialTargetsKey, java.lang.String returnScript, Parameter[] parameters)
           
protected  java.lang.String getChangeScript(UIXRenderingContext context, UINode node, java.lang.String returnScript)
           
protected  java.lang.String getChangeScript(UIXRenderingContext context, UINode node, java.lang.String returnScript, java.lang.String startScript, java.lang.String endScript, java.lang.String extraKey, java.lang.String extraValue)
           
protected static int getClientParametersSize(UIXRenderingContext context, Parameter[] parameters)
          Computes the buffer size for client-defined parameters
protected static java.lang.String getDestination(UIXRenderingContext context, UINode node)
           
 java.lang.String getEvent()
          Returns the name of the event that is sent when this ClientAction is activated.
protected  java.lang.String getEventValue(UIXRenderingContext context)
           
protected  java.lang.String getFormName(UIXRenderingContext context, UINode node)
           
 Parameter[] getParameters()
          Returns the parameters that are submitted when the action is invoked.
 Parameter[] getParameters(UIXRenderingContext context, UINode node)
          Returns an array of all parameters to this ClientAction.
 java.lang.String getScript(UIXRenderingContext context, UINode node, java.lang.Boolean returnVal)
          Implementation of ClientAction.getScript().
 java.lang.String getSource()
          Returns the name of the source that is sent when this ClientAction is activated.
protected  java.lang.String getSource(UIXRenderingContext context, UINode node)
           
protected static java.lang.String getSourceKey(URLEncoder encoder, java.lang.String source)
           
protected  java.lang.String getSubmitScript(UIXRenderingContext context, UINode node, java.lang.String returnScript)
           
 boolean isFormSubmitted()
          Tests whether or not this event will be delivered via a form submit.
 boolean isUnvalidated()
          Tests whether or not validation is performed when the action is executed.
protected  boolean isUnvalidated(UIXRenderingContext context)
           
 boolean renderAsEvent(UIXRenderingContext context, UINode node)
          Override of ClientAction.renderAsEvent().
 void setBlocking(boolean isBlocked)
           
 void setEvent(java.lang.String event)
          Sets the event name.
 void setEventBinding(BoundValue eventBinding)
          Sets a BoundValue that will dynamically evaluate the event name.
 void setFormName(java.lang.String formName)
          Sets the source of this action.
 void setFormNameBinding(BoundValue formNameBinding)
          Sets a BoundValue that will dynamically evaluate the source
 void setFormSubmitted(boolean submitted)
          Sets whether or not the event is sent with a form submit or a GET.
 void setParameters(Parameter[] parameters)
          Sets parameters to submit with the form when the action is invoked.
 void setSource(java.lang.String source)
          Sets the source of this action.
 void setSourceBinding(BoundValue sourceBinding)
          Sets a BoundValue that will dynamically evaluate the source
 void setUnvalidated(boolean unvalidated)
          Sets whether or not validation is performed when the action is executed.
 void setUnvalidatedBinding(BoundValue unvalidatedBinding)
          Sets a { @link BoundValue } that will dynamically evaluate the unvalidated value.
 void writeDependencies(UIXRenderingContext context, UINode node)
          Override of ClientAction.writeDependencies().
 
Methods inherited from class org.apache.myfaces.trinidadinternal.ui.action.ClientAction
isTriggerRequired, renderTrigger, renderTrigger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FULL_START_SCRIPT

protected static final java.lang.String FULL_START_SCRIPT
See Also:
Constant Field Values

FULL_END_SCRIPT

protected static final java.lang.String FULL_END_SCRIPT
See Also:
Constant Field Values

_SUBMIT_START

protected static final java.lang.String _SUBMIT_START
See Also:
Constant Field Values

_BLOCK_SCRIPT

protected static final java.lang.String _BLOCK_SCRIPT
See Also:
Constant Field Values
Constructor Detail

FireAction

public FireAction()
Creates a FireAction which will fire an update event by submiting the enclosing form.


FireAction

public FireAction(java.lang.String event)
Creates a FireAction which will submit the enclosing form with the specified event name.

Parameters:
event - The name of the event that should be sent when the FireAction is activated. If null, the event name defaults to "update".

FireAction

public FireAction(java.lang.String event,
                  boolean submit)
Creates a FireAction with the specified event name.

Parameters:
event - The name of the event that should be sent when the FireAction is activated. If null, the event name defaults to "update".
submit - Whether or not a form submit will be used to fire the event
Method Detail

getScript

public java.lang.String getScript(UIXRenderingContext context,
                                  UINode node,
                                  java.lang.Boolean returnVal)
Implementation of ClientAction.getScript().

Specified by:
getScript in class ClientAction
Parameters:
context - The current RenderingContext.
node - The target UINode.
returnVal - Determines whether the final script will return. true or false.

writeDependencies

public void writeDependencies(UIXRenderingContext context,
                              UINode node)
                       throws java.io.IOException
Override of ClientAction.writeDependencies().

Overrides:
writeDependencies in class ClientAction
Parameters:
context - The current RenderingContext.
node - The target UINode.
Throws:
java.io.IOException

getSubmitScript

protected java.lang.String getSubmitScript(UIXRenderingContext context,
                                           UINode node,
                                           java.lang.String returnScript)

getChangeScript

protected java.lang.String getChangeScript(UIXRenderingContext context,
                                           UINode node,
                                           java.lang.String returnScript)

getChangeScript

protected java.lang.String getChangeScript(UIXRenderingContext context,
                                           UINode node,
                                           java.lang.String returnScript,
                                           java.lang.String startScript,
                                           java.lang.String endScript,
                                           java.lang.String extraKey,
                                           java.lang.String extraValue)

getParameters

public final Parameter[] getParameters()
Returns the parameters that are submitted when the action is invoked.


getParameters

public Parameter[] getParameters(UIXRenderingContext context,
                                 UINode node)
Description copied from class: ClientAction
Returns an array of all parameters to this ClientAction. This array will include any parameters generated by this ClientAction itself (e.g. event, source), and all parameters provided by the client.

Overrides:
getParameters in class ClientAction
Parameters:
context - The current RenderingContext.
node - The target UINode.

getSource

public final java.lang.String getSource()
Returns the name of the source that is sent when this ClientAction is activated.


getEvent

public final java.lang.String getEvent()
Returns the name of the event that is sent when this ClientAction is activated.


isFormSubmitted

public final boolean isFormSubmitted()
Tests whether or not this event will be delivered via a form submit.

Returns:
Returns true to indicate that the action will cause a form submit.

isUnvalidated

public final boolean isUnvalidated()
Tests whether or not validation is performed when the action is executed.

Returns:
Returns true to indicate that the action will be invoked without performing validation. Returns false to indicate that validation will be performed.

renderAsEvent

public boolean renderAsEvent(UIXRenderingContext context,
                             UINode node)
Override of ClientAction.renderAsEvent().

Overrides:
renderAsEvent in class ClientAction
Parameters:
context - The current RenderingContext.
node - The target UINode.
See Also:
getParameters()

setFormName

public void setFormName(java.lang.String formName)
Sets the source of this action.


setFormNameBinding

public void setFormNameBinding(BoundValue formNameBinding)
Sets a BoundValue that will dynamically evaluate the source


setEvent

public void setEvent(java.lang.String event)
Sets the event name.


setEventBinding

public void setEventBinding(BoundValue eventBinding)
Sets a BoundValue that will dynamically evaluate the event name.


setSource

public void setSource(java.lang.String source)
Sets the source of this action.


setSourceBinding

public void setSourceBinding(BoundValue sourceBinding)
Sets a BoundValue that will dynamically evaluate the source


setParameters

public void setParameters(Parameter[] parameters)
Sets parameters to submit with the form when the action is invoked.


setFormSubmitted

public void setFormSubmitted(boolean submitted)
Sets whether or not the event is sent with a form submit or a GET.

Parameters:
submitted - Boolean value indicating whether or not this event should be passed via a form submit.

setUnvalidated

public void setUnvalidated(boolean unvalidated)
Sets whether or not validation is performed when the action is executed.

Parameters:
unvalidated - Boolean value indicating whether or not validation should be performed when invoking the action. If true, no validation is performed. By default, unvalidated is false, in which case validation is performed.

setUnvalidatedBinding

public void setUnvalidatedBinding(BoundValue unvalidatedBinding)
Sets a { @link BoundValue } that will dynamically evaluate the unvalidated value.


getEventValue

protected java.lang.String getEventValue(UIXRenderingContext context)

isUnvalidated

protected boolean isUnvalidated(UIXRenderingContext context)

appendJSParameter

protected static void appendJSParameter(java.lang.StringBuffer buffer,
                                        java.lang.String value)

appendURLParameter

protected static void appendURLParameter(java.lang.StringBuffer buffer,
                                         java.lang.String name,
                                         java.lang.String value)

appendClientParameters

protected static void appendClientParameters(UIXRenderingContext context,
                                             java.lang.StringBuffer buffer,
                                             Parameter[] parameters)

getClientParametersSize

protected static int getClientParametersSize(UIXRenderingContext context,
                                             Parameter[] parameters)
Computes the buffer size for client-defined parameters


getBufferSize

protected static int getBufferSize(UIXRenderingContext context,
                                   java.lang.String startScript,
                                   java.lang.String endScript,
                                   java.lang.String destination,
                                   java.lang.String formName,
                                   java.lang.String event,
                                   java.lang.String source,
                                   java.lang.String partialTargets,
                                   java.lang.String eventKey,
                                   java.lang.String sourceKey,
                                   java.lang.String partialTargetsKey,
                                   java.lang.String returnScript,
                                   Parameter[] parameters)

getDestination

protected static java.lang.String getDestination(UIXRenderingContext context,
                                                 UINode node)

getSourceKey

protected static java.lang.String getSourceKey(URLEncoder encoder,
                                               java.lang.String source)

getSource

protected java.lang.String getSource(UIXRenderingContext context,
                                     UINode node)

getFormName

protected java.lang.String getFormName(UIXRenderingContext context,
                                       UINode node)

setBlocking

public void setBlocking(boolean isBlocked)


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.