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

G

Gogo

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
 
S

Sudsy

Gogo said:
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 logic:present and logic:notPresent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top