I am using a BlockTable and colorize its colums depending on object values.
<apex:variable value="" var="column_1_color"/>
<apex:pageBlockTable value="{!objectList}" var="object">
<apex:column>
<apex:variable var="column_1_color"
value="{!IF(object.Name="test","green","red")}"/>
Name:
</apex:column>
<apex:column style="background-color:{!column_1_color}">
{!object.Name}
</apex:column>
</apex:pageBlockTable>
|Name: | xxx |<--red
|Name: | test |<--green
The var needs to render for each row,
but what if I need the var value before creating first |Name: | column?
Is there any tag that keeps me from using an empty column?
Like this: (does not work)
<apex:variable value="" var="column_1_color"/>
<apex:pageBlockTable value="{!objectList}" var="object">
<apex:variable var="column_1_color"
value="{!IF(object.Name="test","green","red")}"/>
<apex:column style="background-color:{!column_1_color}">
Name:
</apex:column>
<apex:column style="background-color:{!column_1_color}">
{!object.Name}
</apex:column>
</apex:pageBlockTable>