Code picks up value from selectOneMenu and selectBooleanCheckbox, even though it is not rendered

Posted by hpe on Stack Overflow See other posts from Stack Overflow or by hpe
Published on 2010-06-11T13:21:49Z Indexed on 2010/06/14 7:42 UTC
Read the original article Hit count: 279

Filed under:
|

I've got code the following code in my .xhtml

<t:panelGroup rendered="false">
  <t:selectOneMenu id="id" value="#{row.someValue}" displayValueOnly="#{form.readState}">
        <f:selectItems value="#{row.listOfValues}"/>
  </t:selectOneMenu>
</t:panelGroup>

The listOfValues is set in a form populator, and is thus present in the form object. Also, as expected, the portion outlined above is not rendered in the output HTML.

But, when clicking the save button in the page the following code tries to get the value from the XHTML, even though it is not rendered. It will thus not copy the value present in the form, but set it to null (as it is not set in the XHTML).

object1.setSomeValue(form.getSomeValue());

As far as I can see this only happens with selectBooleanCheckbox and selectOneMenu. E.g. inputText works fine.

Any idea on how to fix it?

© Stack Overflow or respective owner

Related posts about jsf

Related posts about tomahawk