You need to sign in to do that
Don't have an account?
yvk431
Show/Remove required for dependant picklists
HI,
I have a requirement to customize few picklists as there were lot of lovs which exceeded the actual limit . FOr now I am fetching the lovs from the object records by querying and assigining the to the custom select options on VFP. But my problem is there are few other dependant picklist which are conditionally manadatory. So is there a way to make the dependant picklists conditionally mandatory on visual force page.
--yvk.
Atlast I fgure it out, i just need to use actionSupport for the onchange event of standard Stage picklist. As the action on stage is triggering the validations by default.
<apex:pageblockSection id="pbsStgnm">
<apex:pageBlockSectionItem>
<apex:outputLabel value="{!$ObjectType.opportunity.fields.stageName.label}" for="stage"/>
<apex:actionRegion>
<apex:inputField value="{!Opportunity.stageName}" required="true" >
<apex:actionSupport event="onchange" rerender="pbDisp" />
</apex:inputField>
</apex:actionRegion>
</apex:pageBlockSectionItem>
--yvk
All Answers
You can use the "required" attribute on an input element to make it required, possibly conditionally (use a formula, such as {!fieldXRequired} ).
Hi Sfdcfox,
I tried that, but the issue was when I am trying to remove the required mark using hte formulae, it still remaining there and showing the validation you "must enter". Please find the mark up below
THe custom picklists functionality is working fine, all i wanted is to mimic the standard dependancy functionality between stage, probability, Disposition Info. Can you please suggest any work around in this regard.
Thanks
--yvk
Atlast I fgure it out, i just need to use actionSupport for the onchange event of standard Stage picklist. As the action on stage is triggering the validations by default.
<apex:pageblockSection id="pbsStgnm">
<apex:pageBlockSectionItem>
<apex:outputLabel value="{!$ObjectType.opportunity.fields.stageName.label}" for="stage"/>
<apex:actionRegion>
<apex:inputField value="{!Opportunity.stageName}" required="true" >
<apex:actionSupport event="onchange" rerender="pbDisp" />
</apex:inputField>
</apex:actionRegion>
</apex:pageBlockSectionItem>
--yvk