You need to sign in to do that
Don't have an account?
Brad Nordling 9
How can I change the color of a pageblocktable row conditionally?
I am looking at this post online, like others I've seen, that shows how to do this with styleclass:
styleClass = "{! If(lstGrnRate.Status__c=='RED' ,'redColour', If(lstGrnRate.Status__c=='GREEN','greenColour', 'greyColour')) }" />
My question is the comparison includes a value from the current record on the left but on the right, it is hard coded (=='RED'). How can I specify a value from the controller on the right side?
I'd like to do it something like this but it doesn't work:
styleClass = "{! If(lstGrnRate.Status__c=='{!Property}' ,'redColour', If(lstGrnRate.Status__c=='GREEN','greenColour', 'greyColour')) }" />
styleClass = "{! If(lstGrnRate.Status__c=='RED' ,'redColour', If(lstGrnRate.Status__c=='GREEN','greenColour', 'greyColour')) }" />
My question is the comparison includes a value from the current record on the left but on the right, it is hard coded (=='RED'). How can I specify a value from the controller on the right side?
I'd like to do it something like this but it doesn't work:
styleClass = "{! If(lstGrnRate.Status__c=='{!Property}' ,'redColour', If(lstGrnRate.Status__c=='GREEN','greenColour', 'greyColour')) }" />
Kindly refer this scenario which matches your requirement :-
https://salesforce.stackexchange.com/questions/93895/conditionally-color-a-row-in-a-pageblocktable
Kindly mark it as the best answer if it works for you.
Thanks & Regards,
Priya Ranjan