+ Start a Discussion
SF_Gh0stSF_Gh0st 

Conditonal Visualforce - display fields based on criteria

Hi, I have a VisualForce page with two columns. In one of those columns I have a field that does not display a value for every contact based on the field. In cases where the field is not displayed the layout of the column shifts and screws up the layout.  Ideally, I'd like to have  if..else situation where the field is displayed based on the fields I have now and if they don't meet the criteria to just enter a blank value or a  , or anything to hold that cell.  So my question is, is there a way in a VisualForce page to do something like:  
IF (criteria are met)
<apex:outputField value="{!con.Access__c}" rendered="{!NOT(con.Do_Not_Show_Birthdate__c) && (con.Deceased__c == 'No')}"/>
            <apex:outputField value="{!con.Access__c}" rendered="{!con.Do_Not_Show_Birthdate__c && bViewBirthdate && (con.Deceased__c == 'No')}"/>

Else
Enter text such as "It doesn't exist" or a blank space.
Thanks
 
PriyaPriya (Salesforce Developers) 
Hey,

Kindly Refer this :- 

https://salesforce.stackexchange.com/questions/244376/visualforce-conditionally-render-2-different-fields-based-on-2-conditions

https://help.salesforce.com/s/articleView?id=000324662&type=1

https://developer.salesforce.com/forums/?id=9060G0000005jiTQAQ

Thanks!