If it were up to me, I'd use a collection of LabelValueBean objects with the label containing the values I want to show accd to the user's Locale. I think it would be much easier than writing a custom tag.
On Wed, 20 Oct 2004 18:14:50 -0300, Colin Kilburn <[EMAIL PROTECTED]> wrote: > Hi All, > > Say I have a bean called Color with three properties: id, name, nameFr > -- corresponding to the default (English) and French versions of the > select option. Depending on the locale, I want to display the > appropriate property (labelProperty) in the options list. What I'd > like to be able to do is say: > > <html:options collection="colorList" property="id" labelProperty="name"/> > > and have the tag know that based on the locale, if it were french, that > it should use nameFr as the labelProperty (if such a property exists). > > I can imagine how I could implement a subclass of the <html:options/> > tag to do this (with a big help from BeanUtils), but I'm wondering if > anyone else has tackled this type of thing before. I can also forsee > needing an equivalent alternative to a <c:out/> or perhaps > <bean:write/>, that knows to append the locale to the property name of > the bean specified. > > I hope this makes sense. I'm ready to roll my own here, but I wanted > to see if anyone else has been here before. Any comments/ideas > appreciated. > > Colin > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]