• Lawrence PrivCo
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I am confused. If I look here:

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_repeat.htm

Then I see:

      <apex:repeat value="{!strings}" var="string" id="theRepeat">

And yet no variable called "strings" is ever defined in the controller:

public class repeatCon {
    public String[] getStrings() {
        return new String[]{'ONE','TWO','THREE'};
    }
}

In Ruby On Rails I would have to declare an instance variable in the controller, or I would get an error if I tried to use it in the view.

Where does {!strings} come from? The controller has no variable called "strings", so how can we use a variable called {strings}

I would have expected {!getStrings}. That would have made sense.
 
Hi,

Please any one can explain me about apex:repeat component in salesforce? where we can use?

regards,
Sain
  • August 11, 2015
  • Like
  • 0