0

I am using jsf2 with weblogic. I want to know in which phase does the UI component e.g inputtext required attribute is validated. The problem i am facing is i have a xhtml page in which i have 2 inputtext and 1 commandbutton. 1st inputtext has an attribute required=true and second inputtext has required=false but has a validator attribute set .the validator method will simply check if the object value i null or no, if its null or empty then i will raise a custom required message. On the click of commandbutton, i see a validation message for the 1st inputtext only. When i enter some text in the 1st inputtext and then i press the button then only i see the required validation message for the 2nd input text.

Why is not the validation message from the validator method shown immediately along with the 1st input text required attribute message.

Please help me. Below is my code.

                <ace:textEntry id="custName" value="#{strformbean.customer1.custName}" size="20" maxlength="50"  label="Customer Name" required="true"  styleClass="requiredField" />    

                    <ace:textEntry id="occupation" value="#{strformbean.customer3.custOccupation}" size="20" required="false" label="Occupation"
                     maxlength="30" styleClass="requiredField" 
                    validator="#{strformbean.validateDOB}" />

                    <h:commandButton id="submitM" type="submit" value="SAVE" action="#{strformbean.getViewId}" actionListener="#{strformbean.saveSTR}"
                   styleClass="submitButton" 
                   />     
4

0 回答 0