problem with jsf / icefaces depended form fields and validation
- by hubertg
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.