0

I am trying to pass a merge field into an apex column header value. The merge field value shows up in a <p> tag in the column, so I know I am getting data, but comes up blank when trying to pass it to the header value. A similar merge field is used in an apex param tag and the value is showing up.

                    <apex:column headerValue="{!calc.sixYearsAgo}">
                         <p> {!calc.sixYearsAgo} <p>
                        <apex:outputText value="{0,number,currency}">
                            <apex:param value="{!calc.allocationSixYearsAgo}" />
                        </apex:outputText>
                    </apex:column>

Again, the value for {!calc.sixYearsAgo} (i.e. would be 2014 in Integer form) shows up in the <p> tag but not in the header value. What am I doing wrong here?

1
  • did you try using the header facet as an alternative?
    – cropredy
    Commented Dec 29, 2020 at 23:35

1 Answer 1

0

You can't use row level merge fields on the header, because Visualforce wouldn't know which one to use. You can use any top-level merge fields you'd like. For example, you could write:

<apex:repeat value="tables" var="table">
  <apex:pageBlockTable value="{!table.rows}" var="row">
    <apex:column headerValue="{!tables.headerValue1}" value="{!row.rowValue}" />
    <!-- etc -->
  </apex:pageBlockTable>
</apex:repeat>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .