I’m using an inputField that is binded directly to a custom objects field in the controller.
The following will generate a dropdown list with a label.
<apex:inputField value="{!Agency_Profile.Location_Principal_Activity__c}" />
My problem is that I need to add the required mark next to the inputField without losing the label or having default error msgs.
when I used
<apex:inputField value="{!Agency_Profile.Location_Principal_Activity__c}" required="true"/>
I got the required mark but I lost my custom error msgs for validation.
when I used
<apex:outputPanel styleClass="requiredInput" layout="block">
<apex:outputPanel styleClass="requiredBlock" layout="block"/>
<apex:inputField value="{!Agency_Profile.Location_Principal_Activity__c}" />
</apex:outputPanel>
the labels near the dropdown list didnt show anymore..
Is there a way I can accomplish what I need?
I ended up using this.