problem with jsf / icefaces depended form fields and validation
Posted
by hubertg
on Stack Overflow
See other posts from Stack Overflow
or by hubertg
Published on 2010-03-07T08:48:10Z
Indexed on
2010/03/08
11:36 UTC
Read the original article
Hit count: 725
Hi, I have a form with 3 fields (simplyfied example).
The first one is a checkbox.
<ice:selectBooleanCheckBox value=#{backingBean.bean.visible} ID=checkbox1 partialSubmit=true>
The second one is a
<ice:inputText ID=text1>
The third one is also a
<ice:inputText ID=text2>
text1 should only be visible when checkbox1 is checked. text2 is a required field.
So my first approach with just using #{backingBean.bean.visible} failed because text2 has is required and a validation message appeared (after the checkbox was clicked) when the text2 field is empty. Because of ths valdation error the form was never completely submitted such that the visible property is set (update model phase was never reached).
So my question: how can I make sure text1 is only visible when checkbox1 is clicked? Thanks.
© Stack Overflow or respective owner