Jsf validation issue - applies required field validation for disabled input fields?

JSF does the validation based on the JSF UIComponent tree in the server side, not on the HTML DOM tree in the client side as you seem to expect. With jQuery you're only changing the HTML DOM tree in the client side without notifying JSF about the state change so that it could reflect it in its component tree You have to disable/enable it using JSF instead of jQuery. As you're using Ajax4jsf, you can use a4j:support for this h:selectOneMenu value="#{bean.

State}" required="true"> You could do that in the getter method or in the valueChangeListener of the state dropdown.

JSF does the validation based on the JSF UIComponent tree in the server side, not on the HTML DOM tree in the client side as you seem to expect. With jQuery you're only changing the HTML DOM tree in the client side without notifying JSF about the state change so that it could reflect it in its component tree. You have to disable/enable it using JSF instead of jQuery.As you're using Ajax4jsf, you can use a4j:support for this.

In this example, the will re-render the country dropdown on every change of the state dropdown. The country dropdown in turn has a its disabled attribute attached to a boolean bean property. You have to make sure that it returns the desired outcome based on the currently selected state.

You could do that in the getter method or in the valueChangeListener of the state dropdown.

In this case I will get two validation errors. I am not sure how realistic is this on real production servers? Basically it would depend on the server's response time.

Is this a good practice to follow i. E firing ajax resquests to change the state of the ui components – Aarti Grover Sep 23 '10 at 12:39 Either overlay the page or disable the submit button while Ajax request is running. – BalusC Sep 23 '10 at 12:52.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions