You need to sign in to do that
Don't have an account?

VF Tag condition help
Hi All,
I am trying to render few fields based on the value of a picklist field. When the value of Picklist is changed to Old then only fields A, B, C must be shown. When the Value of Picklist is changed to New then all 5 fields A,B,C,D, E must be shown. Please help me on how to show two different conditions in Visualforce page tag for a Picklist field.
Following is the code.
<apex:inputField value="{!A}" rendered="{!Picklist == 'New'}"/>
<apex:inputField value="{!B}" rendered="{!Picklist == 'New'}"/>
<apex:inputField value="{!C}" rendered="{!Picklist == 'New'}"/>
<apex:inputField value="{!D}" rendered="{!Picklist == 'New'}"/>
<apex:inputField value="{!E}" rendered="{!Picklist == 'New'}"/>
I was able to show all 5 fields when Picklist value is New. How can I add anther condition? Any help would be highly appreciated.
Thanks,
Raghu
I am trying to render few fields based on the value of a picklist field. When the value of Picklist is changed to Old then only fields A, B, C must be shown. When the Value of Picklist is changed to New then all 5 fields A,B,C,D, E must be shown. Please help me on how to show two different conditions in Visualforce page tag for a Picklist field.
Following is the code.
<apex:inputField value="{!A}" rendered="{!Picklist == 'New'}"/>
<apex:inputField value="{!B}" rendered="{!Picklist == 'New'}"/>
<apex:inputField value="{!C}" rendered="{!Picklist == 'New'}"/>
<apex:inputField value="{!D}" rendered="{!Picklist == 'New'}"/>
<apex:inputField value="{!E}" rendered="{!Picklist == 'New'}"/>
I was able to show all 5 fields when Picklist value is New. How can I add anther condition? Any help would be highly appreciated.
Thanks,
Raghu
Try this, if you have more than 2 picklist values, or if you don't want to show any of the field when picklist is blank
Otherwise the previous solution will work
All Answers
Try this, if you have more than 2 picklist values, or if you don't want to show any of the field when picklist is blank
Otherwise the previous solution will work
I guess, the next solution will work for you