function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ryan PatRyan Pat 

Help in VF page hiding output-fields based on condition

Hi i have a requirement where we have a custom object call managment__c  and 
where on a field stage__c is stage-2 
it will hide survey__c field from vf page how can i achieve ?
<apex:OutputField value="{!Managment__c.stage__c}" rendered="{! IsSurvey || IsIsSurveyDETAILS }"/>
 <apex:OutputField value="{!Managment__c.survey__c}" rendered="{!IsSurvey}" />

 
Best Answer chosen by Ryan Pat
Raj VakatiRaj Vakati
Try this
 
<apex:OutputField value="{!Managment__c.stage__c}" 
rendered="{!IF(Managment__c.stage__c ='stage-2 ' || Managment__c.stage__c ='stage-3' ,true,false)}"/>


 <apex:OutputField value="{!Managment__c.survey__c}" rendered="{!IF(Managment__c.stage__c ='stage-2 ',true,false)}" />

 

All Answers

Raj VakatiRaj Vakati
Try this
 
<apex:OutputField value="{!Managment__c.stage__c}" 
rendered="{!IF(Managment__c.stage__c ='stage-2 ' || Managment__c.stage__c ='stage-3' ,true,false)}"/>


 <apex:OutputField value="{!Managment__c.survey__c}" rendered="{!IF(Managment__c.stage__c ='stage-2 ',true,false)}" />

 
This was selected as the best answer
Ryan PatRyan Pat
Hey Raj it is not working and condition is 

when stage field value is stage-2  

then only survey__c should will show in to page .

there is also one rendered    rendered="{!IsSurvey}" method is created .
Ryan PatRyan Pat
Raj it work thank you