You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Olikkadavath, Bobby" <Bo...@pgnmail.com> on 2002/06/14 21:27:48 UTC

Iterate Help

I have to write a iterate tag with features of setting up a max limit of
items that can be displayed from a collection.
for ex there is a collection of Employees (employeeList). The Employee class
has getName and getAddress.
Now out of the 50 or more employees I want to display 10 employee names at a
time with a next and previous link. If the person clicks on one of the
listed employee names, I have to display the full address.

Can anyone suggest me how to do this with the iterate tag. Or can anyone
direct me to a tutorial or help that goes in depth into the iterate tag. All
the help I found on the web were very basic in nature.

Thanks
Bobby

Re: Iterate Help

Posted by David Geary <sa...@earthlink.net>.
Why write your own tag? I'd recommend using the JSP Standard Tag 
Library, which has a <c:forEach> action that's just what you're looking 
for. See this URL:

http://java.sun.com/products/jsp/jstl/index.html


david

Olikkadavath, Bobby wrote:

>I have to write a iterate tag with features of setting up a max limit of
>items that can be displayed from a collection.
>for ex there is a collection of Employees (employeeList). The Employee class
>has getName and getAddress.
>Now out of the 50 or more employees I want to display 10 employee names at a
>time with a next and previous link. If the person clicks on one of the
>listed employee names, I have to display the full address.
>
>Can anyone suggest me how to do this with the iterate tag. Or can anyone
>direct me to a tutorial or help that goes in depth into the iterate tag. All
>the help I found on the web were very basic in nature.
>
>Thanks
>Bobby
>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Iterate Help

Posted by ul...@muehlgasse.de.
Zitat von "Olikkadavath, Bobby" <Bo...@pgnmail.com>:

> I have to write a iterate tag with features of setting up a max limit of
> items that can be displayed from a collection.
> for ex there is a collection of Employees (employeeList). The Employee
> class
> has getName and getAddress.
> Now out of the 50 or more employees I want to display 10 employee names at
> a
> time with a next and previous link. If the person clicks on one of the
> listed employee names, I have to display the full address.
> 
> Can anyone suggest me how to do this with the iterate tag. Or can anyone
> direct me to a tutorial or help that goes in depth into the iterate tag.
> All
> the help I found on the web were very basic in nature.
> 
> Thanks
> Bobby
> 

I managed this task in the action class, where the complete set of data is 
stored in a collection received from the bussiness logic. The task is now to 
generate a new collection in your form bean, which holds only the desired set 
of datas.

Uli 




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re[2]: Iterate Help

Posted by Rick Reumann <ma...@reumann.net>.
On Friday, June 14, 2002, 6:08:05 PM, Joseph wrote:

JB> There's also the "display" tag library that provides lots o'
JB> functionality for tables, paging, sorting, etc, with great
JB> documentation and examples:

JB> http://edhill.its.uiowa.edu/display/

    Just wanted to chime in and second how awesome this tag is.
    I wish I had this tag when doing some of my old projects. A
    definite must have tag.

-- 

Rick
mailto:maillist@reumann.net

"Sometimes when I feel like killing someone, I do a little trick to
calm myself down. I'll go over to the persons house and ring the
doorbell. When the person comes to the door, I'm gone, but you know
what I've left on the porch? A jack-o- lantern with a knife stuck in
the side of it's head with a note that says 'You.' After that I
usually feel a lot better, and no harm done." 
  -Jack Handey


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Iterate Help

Posted by Joseph Barefoot <jo...@hereuare.com>.
There's also the "display" tag library that provides lots o' functionality
for tables, paging, sorting, etc, with great documentation and examples:

http://edhill.its.uiowa.edu/display/



> -----Original Message-----
> From: Mark Nichols [mailto:dhsStrutsDeveloper@hotmail.com]
> Sent: Friday, June 14, 2002 1:10 PM
> To: Struts Users Mailing List
> Subject: Re: Iterate Help
>
>
> You want the JSPTags "pager" tag. Get it here:
> http://jsptags.com/tags/navigation/pager/
>
> </mark>
>
>
> ----- Original Message -----
> From: "Olikkadavath, Bobby" <Bo...@pgnmail.com>
> To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
> Sent: Friday, June 14, 2002 2:27 PM
> Subject: Iterate Help
>
>
> > I have to write a iterate tag with features of setting up a max limit of
> > items that can be displayed from a collection.
> > for ex there is a collection of Employees (employeeList). The Employee
> class
> > has getName and getAddress.
> > Now out of the 50 or more employees I want to display 10
> employee names at
> a
> > time with a next and previous link. If the person clicks on one of the
> > listed employee names, I have to display the full address.
> >
> > Can anyone suggest me how to do this with the iterate tag. Or can anyone
> > direct me to a tutorial or help that goes in depth into the iterate tag.
> All
> > the help I found on the web were very basic in nature.
> >
> > Thanks
> > Bobby
> >
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Iterate Help

Posted by Mark Nichols <dh...@hotmail.com>.
You want the JSPTags "pager" tag. Get it here:
http://jsptags.com/tags/navigation/pager/

</mark>


----- Original Message -----
From: "Olikkadavath, Bobby" <Bo...@pgnmail.com>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Friday, June 14, 2002 2:27 PM
Subject: Iterate Help


> I have to write a iterate tag with features of setting up a max limit of
> items that can be displayed from a collection.
> for ex there is a collection of Employees (employeeList). The Employee
class
> has getName and getAddress.
> Now out of the 50 or more employees I want to display 10 employee names at
a
> time with a next and previous link. If the person clicks on one of the
> listed employee names, I have to display the full address.
>
> Can anyone suggest me how to do this with the iterate tag. Or can anyone
> direct me to a tutorial or help that goes in depth into the iterate tag.
All
> the help I found on the web were very basic in nature.
>
> Thanks
> Bobby
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>