As I was experimenting with JSF 2.0 , i came across a scenario like this .
I have two text fields – based on input of first field an ajax call is fired using
<f:ajax ... />
After the response is back I am re rendering the second text field ..but i want to disable the second text field based on some server side validation of first field value.
I don’t want to set the disabled using style based on a third property which is being set in the bean after validation.
Is there any alternative ways..
thanks in advance
Bind the first input component to the view by
bindingattribute and useUIInput#isValid()in thedisabledattribute of the second input field. It will returnfalseif validation has failed on the given input component.