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
nextdoornextdoor 

Loop and objects

<body>

Hi,

I want to do something like this in Page:

 

for  (j=0; j< {!getGetMyDossiersIntilak.size}; j++ ) { 
     
      
     geocoder.geocode( { 'address':'{!getGetMyDossiersIntilak[j].Ville__c}' }, function(results, status)

 

But it's not working because of the variable "j" in {!getGetMyDossiersIntilak[j].Ville__c} . If I put an integer number instead as "0" it will work but I want to make it work with a variable.

 

Some help please :)

 

 </body>

 

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Edwin VijayEdwin Vijay

You can use that notation only in classes, not in your page..

 

Maybe, you could use a combination of VF tags and javascript

 

use a apex:repeat instead of the for loop and place your second line inside the apex:repeat

All Answers

Edwin VijayEdwin Vijay

You can use that notation only in classes, not in your page..

 

Maybe, you could use a combination of VF tags and javascript

 

use a apex:repeat instead of the for loop and place your second line inside the apex:repeat

This was selected as the best answer
nextdoornextdoor

I'm using this in my page, and I also use a combination of VF tags and javascripts. 

And it seems like using apex:repeat works !

Thank you !!