dev@jsftemplating.java.net

Re: Drop-downs

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Wed, 09 Aug 2006 14:32:56 -0700

Hi Ana,

Unfortunately the way that particular implementation of a DropDown is
implemented this is not possible. They decided to use a specialized
class in its list of entries and disallow the use of arrays of Strings
or other simple types. So essentially you must either use a handler
(which is backed by java code), a better factory (java code), a jsp tag
handler (which has custom java code -- outside of the scope of
JSFTemplating), or use a backing bean (with custom java code).

So regardless of what you do, you'll need to write Java.

Anissa just asked about array support... as I responded to her, it
exists in the XML syntax and I may add it to the template syntax (if I
can come up w/ a good way to present this). If I make this available, a
factory or a handler could easily take the String array(s) and convert
it to the required objects that the DropDown requires.

Do you have ideas for a syntax? Perhaps:

    <someComponent someAttribute={"A", "B", "C"} />

I could even use {}'s for List creation and [] for array creation?? If
I support array creation, should I use Object? Or String as the base
type... I'd probably use Object. Any comments?

Thanks,

Ken

Ana Caballero wrote:
> Hi Ken,
>
> I'm working on the Server Log Levels Page and would like to populate
> the drop-down components without having to call a handler to get the
> labels and values. Is there a way to declare the labels and values in
> the jsf file or do use a backing bean? Please help.
>
> Thanks,
> Ana