"Immediate" on UICommand results in a couple of behaviors.yes, I can see all this in the JSF code. I just do not see where in the spec such behavior is specified. I see events, which phase is used in immediate or other case, but I do not see where it says that such event should interrupt the cycle...( they may, but the way I read this is more for specializations of reference implementation, not for RI itself.) I must be missing something here...
An ActionEvent is broadcast based on the value of its phaseId.
For an immediate UICommand (Button) that phase id is set to "APPLY_REQUEST_VALUES"
when the UICommand is immediate.
This means the event will be broadcast before "PROCESS_VALIDATIONS"
phase begins. Otherwise the event is broadcast after "INVOKE_APPLICATION".
In the immediate case, the lifecycle will terminate before "PROCESS_VALIDATIONS"
and go directly to RENDER_RESPONSE. This happens by way of the default
default ApplicationActionListener. I believe this is "spec'd" by the definition of an "ActionSource".
If the UICommand is not immediate then the lifecycle completes since INVOKE_APPLICATION
is effectively the end of the lifecycle, since the next phase is RENDER_RESPONSE.
in ActionSource docs for isImmediate() i read: "Return a flag indicating that the default
Now any subclass of UICommand or any parent in the chain of "queueEvent" can
change the phase id of the ActionEvent that is bubbling up to the view root.
Our Button extends UICommand and I believe chose to follow the behavior of
UICommand and the behavior inherent in an ActionSource, which causes
the default ApplicationActionListener to be invoked.
ActionListener
provided by the JavaServer Faces implementation should be executed
immediately (that is, during Apply Request Values phase of
the request processing lifecycle), rather than waiting until the Invoke
Application phase."immediate="true"
and ..."If you want a button to
submit a page, you should not
set immediate
,"
-rick
Dmitry Kushner wrote:
wrt https://woodstock.dev.java.net/issues/show_bug.cgi?id=84:
The reported issue deals with button that submits the form and the text field, where button's immediate == true
I have traced the lifecycle processing within LifecycleImpl.execute, and when immediate is true, it requests lifecycle processing to go to Render_Response ( context.getRenderResponse() == true, line 108)
Why immediate flag on the button completes the lifecycle processing ? JSF specification says any component *can *do that, but it does not specify that action *does or must *complete lifecycle processing? I could not find anywhere in the specification where such behavior is described as prescribed....
--
thank you ,
~ dmitry
thank you ,
~ dmitry
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ActionListener
A listener interface for receiving ActionEvent
s. A class that
is interested in receiving such events implements this interface, and then
registers itself with the source UIComponent
of interest, by
calling addActionListener()
.
Method Summary | |
---|---|
void |
processAction(ActionEvent event)
Invoked when the action described by the specified ActionEvent occurs. |
Method Detail |
---|
void processAction(ActionEvent event) throws AbortProcessingException
Invoked when the action described by the specified
ActionEvent
occurs.
event
- The ActionEvent
that has occurred
AbortProcessingException
- Signal the JavaServer Faces
implementation that no further processing on the current event
should be performed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |