Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > <logic:iterate /> iterate beyond items in the collection

Reply
Thread Tools

<logic:iterate /> iterate beyond items in the collection

 
 
Gogo
Guest
Posts: n/a
 
      09-04-2003
Hi,

I have been able to iterate through the collection of items using
<logic:iterate /> from the Struts tld.

My problem is to present the user with a form with prepopulated
values.
The values are populated from the items within the collection.

Using the following helps me in showing the values within the
collection.

<logic:iterate collection="<%=myCollection%>" id="col">
Enter Name : <html:text name="col" property="name">
</logic:iterate>

But, what if my collection is null or my collection has 0 items? I
still want
to display the textboxes to the user for entering the list of names
(say, at least 10). I guess, it must be a very small and easy
solution. Being totally new to Struts, I can't locate a property on
logic:iterate which could tell it to display the textboxes even if
there are no items.

TIA,
Gogo
 
Reply With Quote
 
 
 
 
Sudsy
Guest
Posts: n/a
 
      09-04-2003
Gogo wrote:
> Hi,
>
> I have been able to iterate through the collection of items using
> <logic:iterate /> from the Struts tld.
>
> My problem is to present the user with a form with prepopulated
> values.
> The values are populated from the items within the collection.
>
> Using the following helps me in showing the values within the
> collection.
>
> <logic:iterate collection="<%=myCollection%>" id="col">
> Enter Name : <html:text name="col" property="name">
> </logic:iterate>
>
> But, what if my collection is null or my collection has 0 items? I
> still want
> to display the textboxes to the user for entering the list of names
> (say, at least 10). I guess, it must be a very small and easy
> solution. Being totally new to Struts, I can't locate a property on
> logic:iterate which could tell it to display the textboxes even if
> there are no items.
>
> TIA,
> Gogo


Check into logicresent and logic:notPresent

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to iterate 2 nested collections w <logic:iterate> without a"getter" John Java 4 04-01-2008 09:46 AM
Collection problems (create Collection object, add data to collection, bind collection to datagrid) Øyvind Isaksen ASP .Net 1 05-18-2007 09:24 AM
nested:iterate or logic: iterate with multibox?? runescience Java 0 02-09-2006 12:57 AM
Iterate every Page Page.Controls collection in a project at design-time James Doran ASP .Net 2 06-15-2004 12:41 PM
The best way to update a collection in a struts page using "logic:iterate" Zhao Java 0 09-16-2003 09:16 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57