users@javaserverfaces.java.net

Re: immediate on command component renders response

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Thu, 13 Apr 2006 11:28:23 -0700

Michael Youngstrom wrote:
> I feel I have a pretty good grasp on things in JSF and then suddenly
> some functionality throws me for a loop.
>
> The latest loop I've been thrown is that apparently when immediate is
> set on a UICommand component then after ApplyRequestValues all other
> phases are automatically short circuited.
>
> Given the following example:
>
> <h:form>
> <h:inputText valueChangeListener="#{test.validate}"
> value="#{test.stringValue}"/>
> <h:commandButton value="Immediate" immediate="true"/>
> </h:form>
>
> If I input some values into the inputText then click the button
> "Immediate" #{test.validate} is never called. This happens because
> com.sun.faces.application.ActionListenerImpl is being called which
> calls context.renderResponse().
>
> For some reason I always thought that an immediate ActionEvent would
> only short circuit the rest of the phases if a user specific
> actionListener associated with the component called renderResponse().
> Am I wrong or is this a bug?
>
I think the behavior you're describing is correct. If you look at the
documentation
for UICommand.broadcast(), the ActionEvents will be sent to any custom
defined
ActionListener as well as the application ActionListener.
> Granted I cannot think of many cases where an immediate button press
> would not want to render the response right away it just caught me off
> guard.
>
> Mike
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_javaserverfaces.dev.java.net
> For additional commands, e-mail: users-help_at_javaserverfaces.dev.java.net
>
>