0

I have a VisualForce page that render into a PDF file with the following component declaration:

<apex:dataTable value="{!someSObjectList}" var="SObj"
  rowClasses="{!IF( MOD( pos, 2 ) == 0, "grey_box,white_box", "white_box,grey_box" )}">
  .
  .  [column declarations]
  .
</apex:dataTable>

However, I cannot get it to compile. Attempting to save prompts the following error message:

Save error: The element type "apex:dataTable" must be terminated by the matching end-tag "</apex:dataTable>".

How can I accomplish this (i.e. get zebra patterning with context-dependant first colour)?

Thank you in advance!

3

I think that the compiler is upset by your using double quotes inside your double quotes where you have:

rowClasses="{!IF( MOD( pos, 2 ) == 0, "grey_box,white_box", "white_box,grey_box" )}"

try:

rowClasses="{!IF( MOD( pos, 2 ) == 0, 'grey_box,white_box', 'white_box,grey_box' )}"
  • As using single class tags between double quotations used to work, it didn't occur to me that this might be the problem. This looks like some VF inconsistency. Thanks for the answer! – André Medeiros May 14 '13 at 14:53
  • Glad it helped you out :) – Doug B May 14 '13 at 14:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.