I've created a Visualforce page to receive input form a user. I've converted a Picklist into a radio button and set it to required.
For whatever reason, the red bar that represents a mandatory field does not display on the form. If I try to submit the form, it will behave as though the radio button is required, but no message is displayed to inform the user. (i.e the page is reloaded with the existing data and won't submit until an option in the radio button is selected)
I've checked the html and the requireBlock
/requiredInput
classes aren't there, so it's not a display/render issue.
The relevant code:
<apex:selectRadio value="{!cObject.cField__c}" required="true">
<apex:selectOptions value="{!items}"/>
<apex:actionSupport event="onchange" reRender="affected_div" />
</apex:selectRadio>
where {!items}
refers to a class in my custom controller that creates the selectOptions
based on the available picklist values.
Looking at the documentation, the required
attribute is supposed to work on the selectRadio
element.
Has anyone else come across this behaviour before? If so, was there a solution?