You need to sign in to do that
Don't have an account?
bolaurent.ax1262
required validation fail message is ugly
I have a bit of markup that displays a pulldown menu for an apex variable, and the field is required.
The markup looks like this:
<apex:pageBlockSectionItem > <apex:outputLabel value="Select Territory" for="territory"/> <apex:outputPanel layout="block" styleClass="requiredInput"> <apex:outputPanel layout="block" styleClass="requiredBlock"/> <apex:actionRegion> <apex:selectList value="{!theTerritoryUtility.territoryId}" id="territory" size="1" required="True"> <apex:selectOptions value="{!theTerritoryUtility.territoryOptions}"/> <apex:actionSupport event="onchange" rerender="leadDelegation"/> </apex:selectList> </apex:actionRegion> </apex:outputPanel> </apex:pageBlockSectionItem>
And when the user tries to save without entering a value, the error message looks like this:
thePage:theForm:thePageBlock:leadDelegation:j_id368:territory: Validation Error: Value is required.
Is there something I can do to make the error message less ugly?
Hi,
If it is possible can you please post your code (VF page + apex controller) so that we can resolve your issue in effective manner?
The VF is posted above. The entire page is more complex, but I doubt that the rest of the page has anything to do with the error message that VF produces for a required field validation failure.
Here is the code, very simplified. I have verfiied that the VF page compiles and still produces the error.
The error on save:
Hi Bolaurent, were you able to get a cleaner looking error message?
No, I was not.
I figured it out, if you use the label attribute in selectlist, inputfield or inputtext the label is referenced as opposed to the component ID.