Use Of bean:size Tag
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Mark_Gowdy
Posted On:   Thursday, May 29, 2003 08:26 AM

Hi


I wish to make use of the tag, and would appreciate any guidance. I have a select list box, which can contain numerous options. These are populated using a tag. Now I would like to automatically size the select list box to show ALL of the options.


What I thought about doing was using to find out how many elements are in the Collection, and somehow using this Integer [perhaps with javascript or other means] to come up with a height for the select box.


Any ideas?


Thanks


Mark

Re: Use Of bean:size Tag

Posted By:   Christopher_Koenigsberg  
Posted On:   Thursday, May 29, 2003 09:54 AM

I regularly use the bean:size tag to determine if the collection is zero length (e.g. a "logic:equal" to zero, on the value from the bean:size), meaning there are no items, hence I shouldn't just display an empty table with the same "Here are the items:" heading.... instead I display "Your search returned no items" or something like that.



It's also useful for "Your search returned N items" vs. "Your search returned 1 item" (e.g. no plural "s" on the "item" if only 1)...

About | Sitemap | Contact