Please ignore this topic as the problem was due a typo in my jsp. I apologize 
for wasting your time on an issue that is not a problem, I should have checked 
more carefully.

regards,



----- Original Message ----
From: Struts Two <[EMAIL PROTECTED]>
To: Struts Users Mailing List <user@struts.apache.org>
Sent: Friday, October 31, 2008 5:43:55 PM
Subject: Re: How to run an iterator twice in a page

I was hoping to find a better way to do this for a case as simple as the this 
one rather than resorting to hacks. Normally in JSTL when c:foreach is used a 
new iterator is created. I also tried the following in the second iterator but 
of no avail

<s:iterator value="[1].users" id="u" status="status">

I also tried to move users into request scope [ <s:set id="users" name="users" 
scope="request" value="users"/>] and then try

<s:iterator value="#request.users" id="u" status="status">

in both iterators, But only the first table is displayed.



----- Original Message ----
From: "Peterson, Ryan" <[EMAIL PROTECTED]>
To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, October 31, 2008 5:10:39 PM
Subject: RE: How to run an iterator twice in a page

It's sort of "hack-ish", but can you make a copy of the list of users in the 
Java code, and iterate over the copied list for the 2nd set of results?

-----Original Message-----
From: Struts Two [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 31, 2008 1:36 PM
To: Struts Users Mailing List
Subject: How to run an iterator twice in a page

I have a list of users and I would like to iterate over this list twice in a 
page. However in the following code snippet, The list is iterated only once and 
the second iterator displays nothing.

<p>Table 1</p>
<table cellspacing="1" cellpadding="0" class="basic-table" width="100%">
    <tr class="gray-med-dark">
       <th nowrap="nowrap" scope="col">user id</th>
       <th nowrap="nowrap" scope="col">user name</th>
   </tr>
   <s:iterator value="users" id="u" status="status">
      <tr >
           <td><s:property value="#u.id" /></td>
           <td><s:property value="#u.name" /></td>
      </tr>
   </s:iterator>
</table>

<p>Table 2</p>
<table cellspacing="1" cellpadding="0" class="basic-table" width="100%">
     <tr class="gray-med-dark">
          <th nowrap="nowrap" scope="col">user id</th>
          <th nowrap="nowrap" scope="col">user name</th>
     </tr>
     <s:iterator value="users" id="u" status="status">
      <tr >
           <td><s:property value="#u.id" /></td>
           <td><s:property value="#u.name" /></td>
      </tr>
     </s:iterator>
</table>

In the second iterator I even renamed the id to u1 but of no avail. I think in 
the first iterator all the user objects are pushed on the top of stack hence 
users is not availabe on the second iterator. I would appreciate any hints on 
how to achieve this.


      __________________________________________________________________
Looking for the perfect gift? Give the gift of Flickr! 

http://www.flickr.com/gift/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


      __________________________________________________________________
Be smarter than spam. See how smart SpamGuard is at giving junk email the boot 
with the All-new Yahoo! Mail.  Click on Options in Mail and switch to New Mail 
today or register for free at http://mail.yahoo.ca


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


      __________________________________________________________________
Ask a question on any topic and get answers from real people. Go to Yahoo! 
Answers and share what you know at http://ca.answers.yahoo.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to