Textfield within the logic:iterate tag not displayed initially since the collection is null
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sana_jay
Posted On:   Thursday, April 8, 2004 05:16 AM

hello, i want to input 4 textfields and have a property of String[] array in my form. but with logic:iterate tag initially the jsp does not display the textfields since the collection is null. Only on submitting the textfields are displayed with the values set in the form through the action class. Can anyone plz explain how to iterate when the coll is null. Also how to set the size of the iteration. Thanks regards Sana    More>>

hello,



i want to input 4 textfields and have a property of String[] array in my form.




but with logic:iterate tag initially the jsp does not display the textfields since the collection is null.
Only on submitting the textfields are displayed with the values set in the form through the action class.




Can anyone plz explain how to iterate when the coll is null.



Also how to set the size of the iteration.



Thanks



regards



Sana

   <<Less

Re: Textfield within the logic:iterate tag not displayed initially since the collection is null

Posted By:   Erik_Runia  
Posted On:   Thursday, April 8, 2004 07:50 AM

It sounds like you want to show 4 blank text inputs if the collection is null? If this is the case, use the logic:empty tag in order to test for "emptyness" in a collection, and then display the 4 blank fields (using struts tags of course). You can then iterate through normally or put your iteration in a logic:notEmpty body to be even cleaner.



As for your question about the size of the iteration, I'm not sure what you mean, as an iterater tag will iterate over your entire collection, based on how much you put in it on init or during your actions.

About | Sitemap | Contact