struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glanville, Jay" <>
Subject can I use resource keys in html:optionsCollection?
Date Wed, 18 Feb 2004 14:06:19 GMT
I've looked in the documentation and I can't find my answer, so I'm
assuming that the answer is "no".  However, I'm posing the question to
this list in case I've missed something.

I'm using an <html:optionsCollection> tag to display a list of options
inside my <html:select> tag.  However, I want the labels not to be
directly populated from collection.label, but from my resource bundle
through keys.  In other words, I don't want my collection to be a set of
label - value pairs, but to be a set of label key - value pairs.

Is there a way to have optionsCollection use label keys as opposed to

I've thought of two ways that I can work around this limitation, but I'd
prefer to use the simpler html:optionsCollection method.  My workarounds
1) to use <logic:iterate> to iterate over the collection, and then use
individual <html:option> tags using the key attribute.
2) when creating my collection, resolve my bundle key into a bundle
value for the collection's value attribute.

So, suggestions? Feedback? Help?



Jay Glanville

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message