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

Is there aw ay to refer to a constant in a visual force "rendered" expression

Hi all,


I am trying to do something like this:

        <apex:outputText rendered="{!state=SHOW}">This is the dashboard</apex:outputText>

where SHOW is a constant in my controller.(Rather than hard code numbers in my visual force pages).


Is there a way to do this. 




try something like


public string getRendereredConstant(){ return 'Show'; }


and in the VF page



<apex:smileysurprised:utputText rendered="{!renderedConstant}">This is the dashboard</apex:smileysurprised:utputText>


 Not sure if any property of a tag can take an Apex getter method though.





Thanks Paul,


I realized that could be done. Of course, I was trying to avoid creating one such method in my controller for each and every constant in my state machine. 



Thanks for the help, anyway!