• NIkhil Dandekar 18
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I have code to output rows and columns from a controller's data member (a SObject[] collection).

 

The code below works fine. It iterates throough each row in rpt.data, and through each column name in rpt.parsed_clean_field_names, and using a bracket notation, outputs the row[column] just fine.

 

<apex:repeat value="{!rpt.data}" var="row">

     <apex:repeat value="{!rpt.parsed_clean_field_names}" var="header">

              <apex:outputText value="{!row[header]}" escape="false"/>

     </apex:repeat>

</apex:repeat>

 

But when I try to use HTMLENCODE to encode the data (since it may contain characters that I want encoded), I do this (the red bold is the only difference): and it breaks

 

<apex:repeat value="{!rpt.data}" var="row">

     <apex:repeat value="{!rpt.parsed_clean_field_names}" var="header">

              <apex:outputText value="{!HTMLENCODE(row[header])}" escape="false"/>

     </apex:repeat>

</apex:repeat>

 

with the following error message:

Incorrect parameter type for function 'HTMLENCODE()'. Expected Text, received Boolean

Error is in expression '{!HTMLENCODE(row[header])}' in component <apex:outputText> in page exportreport3
 
Apparently HTMLENCODE doesn't recognize the row[column] "getter" notation.
 
Any suggestions as to how I could fool HTMLENCODE into thinking that row[column] is a Text and not a Boolean??
 
Thank you
 
Chris