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
javierjiesjavierjies 

Button ON, Button OFF

Hello everyone

 

I've this button

 

<apex:commandButton action="{!botones}" value="go from {!Status} to the following Status" id="addButton1" />              
 

If the Status is NULL, I've a button with the value = go from  to the following Status

 

I don't want to show the button if the Status is NULL so, any idea?!?!?

 

Thank you in advance

Best Answer chosen by Admin (Salesforce Developers) 
AlsoDougAlsoDoug

Javierjies if you don't want the button to show up if the value of status is null something like this should work.

 

 

<apex:commandButton action="{!botones}" value="go from {!Status} to the following Status" id="addButton1" rendered="{!IF(Status != null, true, false)}"/>

 

 

 

All Answers

AlsoDougAlsoDoug

Javierjies if you don't want the button to show up if the value of status is null something like this should work.

 

 

<apex:commandButton action="{!botones}" value="go from {!Status} to the following Status" id="addButton1" rendered="{!IF(Status != null, true, false)}"/>

 

 

 

This was selected as the best answer
javierjiesjavierjies

Thank you, It worked!

 

But, Why    True,False??

AlsoDougAlsoDoug

Not the expert but I am assuming you can use the if statement for other things in visual force and return other values beyond true or false.

 

Maybe you check a value and return a different css class or something in a styleClass.

 

Haven't used it for anything myself yet beyond the true/false.