You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Peter Rabing <pe...@gmx.de> on 2006/10/05 13:39:55 UTC

Re: Using Tobago dynamically from jsp ??

Hi Volker,

I am steadily making progress with the component tree but I am still battling with a lot of basics. Maybe you can give me a hint:

1. Where do I find some documentation on which TobagoConstants.ATTR_* work on which component ? Is it along the lines of HTML ?

2. I create a combo box:
 UISelectOne combo = new UISelectOne();
 combo.setId( id);
 combo.setRendererType( TobagoConstants.RENDERER_TYPE_SELECT_ONE_CHOICE);

 SelectItem[] items = new SelectItem [ 3];
 for( int i=0; i < 3; i++)
    items[i] = new SelectItem( ""+i, ""+i);
         
 combo.setValue( items);

The combo box is displayed, but disabled and does not contain any values.

In general, what steps do I take to discover what the problem is ?

Thanks,

Peter
           
         
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

Re: Using Tobago dynamically from jsp ??

Posted by Volker Weber <we...@googlemail.com>.
HI Peter,

There is no docu for the TobagoConstants, to find out how to use you
neet to look into the sources.

to create the component structure programatically you need to know the
structure your resulting tree should have.

if in doubt create the structure in jsf tags and rebuild this in java.

each tag could have attributes and subtags as children and facets.

attributes must set at the UIComponent object, take a look at the
Tag-class source code to see how this must done.

subtags, if not the facet tag, are own UIComponent objects which must
added to che children list of the parent.

a facet has only one subtag which is a UIComponent and must added to
the parents facetMap with the name attribute as key.

so far the general steps.
In your case:
the value attribute of selectOneChoice (or any other UISelectOne) mut
be the same type as the selectItems objects (first argument in
constructor).
the SelectItem array must set as value of a UISelectItems subcomponent.

Regards
  Volker




2006/10/5, Peter Rabing <pe...@gmx.de>:
> Hi Volker,
>
> I am steadily making progress with the component tree but I am still battling with a lot of basics. Maybe you can give me a hint:
>
> 1. Where do I find some documentation on which TobagoConstants.ATTR_* work on which component ? Is it along the lines of HTML ?
>
> 2. I create a combo box:
>  UISelectOne combo = new UISelectOne();
>  combo.setId( id);
>  combo.setRendererType( TobagoConstants.RENDERER_TYPE_SELECT_ONE_CHOICE);
>
>  SelectItem[] items = new SelectItem [ 3];
>  for( int i=0; i < 3; i++)
>     items[i] = new SelectItem( ""+i, ""+i);
>
>  combo.setValue( items);
>
> The combo box is displayed, but disabled and does not contain any values.
>
> In general, what steps do I take to discover what the problem is ?
>
> Thanks,
>
> Peter
>
>
> --
> Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
>