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
Adam1Adam1 

conditional display of UI components

I'm dealing with a tricky issue and not sure how to proceed. Hopefully someone can help.
 
What I want to do is have interface elements (let's talk about buttons for the sake of this discussion) that display or not display based on some condition. For example, imagine a list of Leads, and after each Lead there is a button or buttons that only display for Leads with certain properties (e.g. current user is owner).
 
Also, I want to selectively apply styles to certain fields in a list depending on conditions (i.e. highlight some fields in a table in red text if they match a field in another object).
 
How can I accomplish this? Any help would be greatly appreciated.
dchasmandchasman
Take a look at the doc and examples for the rendered, style, and styleClass attributes available on most components (there are also additional component specific style related attributes for things like apex:dataTable). All of these can be assigned values dynamically using page formulas that have access to all kinds of information useful for conditional display and styling.
Adam1Adam1
Hi Doug,
 
Thank you for the response. Can you please point me to a code example that uses page formulas to dynamically assign values to rendered and style? I can't seem to find a good example.
 


Message Edited by Adam1 on 07-07-2008 11:26 AM
Adam1Adam1
Ok, nevermind I figured out how to dynamically set rendered, but it's still not clear how I can set style for a field dynamically.
 
 


Message Edited by Adam1 on 07-07-2008 11:38 AM