You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Mike Kienenberger <mk...@gmail.com> on 2006/07/20 20:08:16 UTC

Re: MyFaces Tomahawk ignores checkbox in dataList on first submission

Try using preserveRowStates=true on your t:dataList and see if that
fixes the problem.  There's some odd behavior of UIData component
state saving that still needs to be addressed for JSF 1.1.

On 7/19/06, Wally Hartshorn <Wa...@epa.state.il.us> wrote:
> We're using MyFaces with Tomahawk and are seeing some strange behavior
> that appears to be related to t:dataList and certain types of form
> elements.
>
> Suppose you have a form with code like this:
>
>     ...
>     <h:selectBooleanCheckbox value="#{myBean.boxNotInDataList}"/>
>     ...
>     <t:dataList value="#{myBean.things}" var="oneThing">
>         ...
>         <h:selectBooleanCheckbox value="#{oneThing.boxInDataList}">
>         ...
>     </t:dataList>
>     ...
>
> Note that one checkbox is outside of the dataList, the other is inside
> the dataList.
>
> Suppose I were to do this:
>
>     * display the form
>     * select both checkboxes
>     * click submit
>
> I would find that the value of the checkbox that is inside the
> t:dataList is ignored -- the value of myBean.boxInDataList would NOT be
> set to "true". The checkbox outside of the t:dataList would work just
> fine.
>
> Stranger still, if I were to:
>
>     * display the form
>     * select both checkboxes
>     * do something that will cause a validation error (e.g. leave a
> required field blank)
>     * click submit
>
> Then I would find that when the form was redisplayed with the
> validation error message, the checkbox within the t:dataList would NOT
> be checked. The checkbox that is outside of the t:dataList would
> properly remember that I had checked it.
>
> Strangest of all, if I were to:
>
>     * display the form
>     * select both checkboxes
>     * do something that will cause a validation error (e.g. leave a
> required field blank)
>     * click submit
>     * observe on the redisplayed form that the checkbox in the
> t:dataList is not checked
>     * reselect the checkbox
>     * correct the validation error
>     * resubmit the form
>
> Then I would find that the value of the checkbox in the t:dataList is
> NO LONGER IGNORED.
>
> What the...?
>
> Is this a bug in MyFaces Tomahawk or is there something subtle going on
> here that I'm missing?  We've seen similar behavior from t:commandLink
> and t:inputFileUpload when they are inside t:dataList.
>
> We're using MyFaces 1.1.3, Tomahawk 1.1.2, Java 5, and Tomcat 5.5.
>