+ Start a Discussion
DianeMDianeM 

Visualforce component error in Summer '09

I have a Visualforce component that works in Spring '09 but fails in Summer '09.  There is code in the page to dynamically create the id for a row within a reapeat tag.

 

 

<Apex:repeat value="{!controller.lines}" var="Line" > <apex:variable var="num" value="{!VALUE(num) + 1}"/> <tr id="Data{!VALUE(num)}" class="dataRow"> <td>&nbsp;</td> <td class="bold" colspan="2">{!Line.itemName}</td> <td>&nbsp;</td> </tr> </Apex:repeat>

 

 I have submitted a case on this - has anyone else seen this?

 

Best Answer chosen by Admin (Salesforce Developers) 
Volker_factory42Volker_factory42

...A long way to it, but now I have the solution:

 

 

<apex:variable value="{!1}" var="posL"/>

 

Pos. <apex:outputText value="{0,number,#}"><apex:param value="{!posL}" /></apex:outputText>

<apex:variable var="posL" value="{!posL+1}"/>

 

 It's working fine, and counting up in i.e. apex:repeat

 

All Answers

wesnoltewesnolte

Hey

 

Can you post a bit of error, and perhaps some of the debug log.

 

Cheers,

Wes 

DianeMDianeM
Good point - I should have indicated the error.  The error occurs when I attempt to save the component with the code above in it.  The error message is not very helpful - it just says Failed validation: ApexComponent
wesnoltewesnolte

Hey

 

Strangely enough I came across this issue yesterday, but the solution was obscure. We're a team of developers and I was working in the Org we use for packaging. This Org was prepending the names of page references within my visualforce pages with the package name i.e.

 

A Page called $Page.pagename

 

became $Page.packageNameSpace__pagename

 

When other developers used my commited code (they are working in normal dev orgs) they your the same error. I had to go through my code and remove the package name from each page reference and it is now sorted:)

 

Cheers,

Wes

 

 

Volker_factory42Volker_factory42
I got the same error, and lot of pages are not working anymore. This error comes with line:

<apex:variable var="varname" value="{!VALUE(varname) + 1}"/>

 So I had to comment this line to get a working VF again.

Volker_factory42Volker_factory42
I posted this Bug in our Partnerportal to get a solution....
Volker_factory42Volker_factory42

...A long way to it, but now I have the solution:

 

 

<apex:variable value="{!1}" var="posL"/>

 

Pos. <apex:outputText value="{0,number,#}"><apex:param value="{!posL}" /></apex:outputText>

<apex:variable var="posL" value="{!posL+1}"/>

 

 It's working fine, and counting up in i.e. apex:repeat

 

This was selected as the best answer