Well this initially seemed very simple but came out to be a disaster. If you are using a inputfield this is pretty easy just use the required="true" attribute and you are good go.
But I was a bit surprised there are no option to mark a PICKLIST field required when using inlineEditSupport basically there is no required attribute for the outfield tag which we generally use for inlineEdit. I did a lot of research on this topic but couldnt find a solution.
<apex:outputField value="{!MyObject__c.MyPicklist__c}" >
<apex:inlineEditSupport event="ondblclick"/>
</apex:outputField>
I know there are workarounds like
- Using a validation rule to throw an error and handle the same in apex to show a pagemessage
- Or simply use apex to show pageMessage
- Use jQuery/JS
I am just wondering if there any other way ? something like marking required in VF