users@javaserverfaces.java.net

immediate on command component renders response

From: Michael Youngstrom <youngm_at_gmail.com>
Date: Wed, 12 Apr 2006 14:19:12 -0600

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?

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