I have a requirement where at some places in the visual force page, there should be required fields so I have put this :
<apex:inputfield id="selectId" value="{!var.field1__c}" required="true" styleclass="mystyle" />
Later I have a custom validation in the controller class that if {!var.field2__c} (That I use to show) is greater than 200, I throw a custom exception (class that extends Exception class) catch it and capture it in <apex:messages styleClass="error_Style" />
Catch(Exception ex) { ApexPages.addMessages(ex) ; }
The thing what is happening is, when i put field1_c empty and field2_c as some value greater than 200 (ex: 300); I get only the required=true error message and not the custom page message that I have. Can anyone tell why is the required error message overriding my custom message? Thanks