You need to sign in to do that
Don't have an account?
TracMikeL
Hide/Show Fields
Hey Guys,
I have the following VF code. I want to render the inputfield when the selectlist selectoptions is empty. And if its not empty show the selectlist only.
is this possible?
<apex:pageBlockSection collapsible="false" columns="2" id="MappingValues"> <apex:inputField id="TargetValue" value="{!Mapping.Value_Out__c}" required="true" /> <apex:selectList id="TargetPickList" value="{!Mapping.Value_Out__c}" size="1"> <apex:selectOptions value="{!TargetPickList}"/> </apex:selectList> </apex:pageBlockSection>
Try rendered attribute as mentioned below
With Best,
crmtech21
All Answers
Hi,
you can use action support to re render the section or page block and use rendered condition in your input field.
<apex:pageblock id="theForm">
<apex:pageBlockSection collapsible="false" columns="2" id="MappingValues">
<apex:inputField id="TargetValue" value="{!Mapping.Value_Out__c}" required="true" rendered="{!if(Mapping.Value_Out__c!='',true,false)}" />
<apex:selectList id="TargetPickList" value="{!Mapping.Value_Out__c}" size="1">
<apex:selectOptions value="{!TargetPickList}"/>
</apex:selectList>
<apex:actionSupport reRender="theForm" event="onchange"/>
</apex:pageBlockSection>
<apex:pageblock>
Hope this helps.
Thanks,
Ahmed
Try rendered attribute as mentioned below
With Best,
crmtech21
Thanks alot! That worked beautifully. Gold star for you! :)