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
OxeneOxene 

Dynamic label styling

I have a VF page in which i'm using 40 outputFields. I want these to be styled according to a particular condition. If the field value satisfies the condition, style1 should be used or else style2 should be used. Now i can write 40 different functions to check whether each field satisfies the criteria or not. I want to use a generalized function by passing some parameter to the function.

But I'm not able to pass parameters to a function from the VF page. Does anybody know how to do this?

How can i do this in a better way so that i use a generalized function?

Please help me out if you have any ideas.
TehNrdTehNrd
How about something like this:

Code:
<apex:outputText value="{!Name}" style="{!if(!Name = 'Test','color:red;font-weight: bold', 'color:black')}"/>