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

Problem with apex:variable that is dependent on the apex:pageBlockTable variable

Here is a contrived example of a problem I have where I have a complicated expression that I'd like to evaluate once per table row using a variable. Instead of v2 corresponding to the current value of v1, it corresponds to the last row value of v1:


<apex:pageBlockTable var="v1" value="{!sobject}">
    <apex:variable var="v2" value="{!v1.StyleField}"/>
    <apex:column value="{!v1.ValueField}" style="{!v2}"/>

Does anyone have any insight into this or ways to get variables to work in this context? I haven't found anything in the documentation about this case.




Mitesh SuraMitesh Sura
This is old thread, but I will reply anyways. This looks to be a bug. It works for apex:repeat tab but not for pageBlockTable. 

Anybody out ther with a solution?