+ Start a Discussion
TejTej 

dynamic color change of a commandlink in pageblock table

i have a commandlink in a pbtable, that should change color conditionally. I am doing something like below but it complains about "Error Error: Syntax error. Missing ')'". any ideas?

<apex:commandlink value="test" action="{!testaction}" style="{!IF(testMap.get(rowId).size > 0, 'background:red;color:white', '')}">
CheyneCheyne
Hmm... that looks like it should work. Could you post the rest of the relevant Visualforce, as well as the relevant controller code?
Ricky MartinRicky Martin

Hi,

you are using "GET" keyword in visualforce page so please use ' [ ] ' bracket when you using the map variable.

style="{!IF(testMap[rowId].size > 0, 'background:red;color:white', '')}"

Please choose as the best answer, if this resolved.