Show an ArrayList<String> in a <tr:table>

View: New views
2 Messages — Rating Filter:   Alert me  

Show an ArrayList<String> in a <tr:table>

by baeschtu baeschtu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I would like to show some Strings in a <tr:table>

I tried the following with an ImageBean.java ..
  public List<String> getAllImages()
  {
      List<String> images = new ArrayList<String>();
      images.add("image01");
      images.add("image02");
      images.add("image03");
      return images;
  }

and would like to access it like this.
                <tr:table var="row" value="#{ImageBean.getAllImages}">
                    <tr:column>
                        <tr:outputText value="#{row[0]}"/>
                    </tr:column>
                </tr:table>


Is there an easy way to do this?

Re: Show an ArrayList<String> in a <tr:table>

by Rafa Pérez :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You should have

<tr:table var="row" value="#{ImageBean.allImages}">

HTH,

-- Rafa


On Tue, Oct 6, 2009 at 3:00 PM, baeschtu baeschtu <baeschtu@...> wrote:
I would like to show some Strings in a <tr:table>

I tried the following with an ImageBean.java ..
  public List<String> getAllImages()
  {
      List<String> images = new ArrayList<String>();
      images.add("image01");
      images.add("image02");
      images.add("image03");
      return images;
  }

and would like to access it like this.
                <tr:table var="row" value="#{ImageBean.getAllImages}">
                    <tr:column>
                        <tr:outputText value="#{row[0]}"/>
                    </tr:column>
                </tr:table>


Is there an easy way to do this?