You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Mariano Petrakovsky <mp...@tecnonexo.com> on 2005/07/01 18:21:11 UTC

New Component

After long time, I'm decide to create a custom component. :P

I want to do a component like ShuttleList of ADF, Two SelectManyListBox,
four CommandButtons (Add, Add All, Remove, Remove All). The elements inside
Lists can move together Lists.

My cuestion is... can extends an existent UIComponent to do this or... I
extends of UIComponent Class :(?
How think is the better mode to do this component? :)
Thanxs!!!


--
Mariano G. Petrakovsky
Programmer · Software Factory
AXG Tecnonexo -  www.tecnonexo.com

Development facilities:Av. Maipú 1252 8º (C1006ACT) · Buenos Aires ·
Argentina.
Tel.: (54-11) 4878-0005 - Fax: (54-11) 4878-0065.

Headquarters: 1604 Spring Hill Road, Suite 160 Vienna · VA 22182 · USA.
Tel.: (202) 986-7541 - Fax: (202) 787-3891.


· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
· · · ·




Re: Antwort: Re: New Component

Posted by Werner Punz <we...@gmx.at>.
I also can recommend Kitos book, I think the appendix example components
are the best introductions you can get into component building currntly.
And yes, SelectMany might be a good headstart as well.
Anything higher than UIComponent pretty much is a better start than 
UIComponent itself.


Werner



mathias.werlitz@daimlerchrysler.com wrote:
> 
> I personally think subclassing UISelectMany would be the best way, 
> because you have to deal with all the converter stuff and the result is 
> similar to a UISelectMany component. But it depends on what requirements 
> you have.
> 
> You can also create subcomponents by code and/or use an existing render 
> of standard components (at Renderer interface level). This explained by 
> KITO D. MANN in the online appendix of "JavaServer Faces in Action".
> 
> Mathias
> 
> news@sea.gmane.org schrieb am 01.07.2005 18:34:28:
> 
>  > Hi Mariano, the best way to do this is to find a component which does
>  > most of the wanted functionality and then write a child class of the
>  > tag, the renderer and the component (if needed)
>  >
>  > You can use UIComponent as a base, but you will save lots of work if you
>  > start with a more high level approach (Most components derive from
>  > something higher than UIComponent or UIInput)
>  >
>  > For the ShuttleList a Panel or a Div might be a good starting point as a
>  > base because you need some kind of Panel Functionality anway.
>  >
>  > Werner
>  >
>  >
>  >
>  > Mariano Petrakovsky wrote:
>  > > After long time, I'm decide to create a custom component. :P
>  > >
>  > > I want to do a component like ShuttleList of ADF, Two 
> SelectManyListBox,
>  > > four CommandButtons (Add, Add All, Remove, Remove All). The 
> elements inside
>  > > Lists can move together Lists.
>  > >
>  > > My cuestion is... can extends an existent UIComponent to do this 
> or... I
>  > > extends of UIComponent Class :(?
>  > > How think is the better mode to do this component? :)
>  > > Thanxs!!!
>  > >
>  > >
>  >


Antwort: Re: New Component

Posted by ma...@daimlerchrysler.com.
I personally think subclassing UISelectMany would be the best way, because 
you have to deal with all the converter stuff and the result is similar to 
a UISelectMany component. But it depends on what requirements you have.

You can also create subcomponents by code and/or use an existing render of 
standard components (at Renderer interface level). This explained by KITO 
D. MANN in the online appendix of "JavaServer Faces in Action". 

Mathias

news@sea.gmane.org schrieb am 01.07.2005 18:34:28:

> Hi Mariano, the best way to do this is to find a component which does 
> most of the wanted functionality and then write a child class of the 
> tag, the renderer and the component (if needed)
> 
> You can use UIComponent as a base, but you will save lots of work if you
> start with a more high level approach (Most components derive from 
> something higher than UIComponent or UIInput)
> 
> For the ShuttleList a Panel or a Div might be a good starting point as a 

> base because you need some kind of Panel Functionality anway.
> 
> Werner
> 
> 
> 
> Mariano Petrakovsky wrote:
> > After long time, I'm decide to create a custom component. :P
> > 
> > I want to do a component like ShuttleList of ADF, Two 
SelectManyListBox,
> > four CommandButtons (Add, Add All, Remove, Remove All). The elements 
inside
> > Lists can move together Lists.
> > 
> > My cuestion is... can extends an existent UIComponent to do this or... 
I
> > extends of UIComponent Class :(?
> > How think is the better mode to do this component? :)
> > Thanxs!!!
> > 
> > 
> 

Antwort: RE: New Component

Posted by ma...@daimlerchrysler.com.
If you output only HTML then you can use HtmlSelectManyListbox.

If it's posssible to use only methods provided by UISelectMany, then use 
the superclass instead. But you have to make sure that the Listbox 
renderer is used by the component.

mpetrakovsky@tecnonexo.com schrieb am 01.07.2005 13:58:16:

> 
> I define this Class... but I have a dude...
> The two list inside of this Class... must be HtmlSelectManyListBox or
> UISelectMany ?
> 
> 
> public class HtmlShuttleList extends UIPanel {
> 
>     public static final String SHUTTLE_LIST_FAMILY = "SLFAMILY";
> 
>     HtmlSelectManyListbox validList;
> 
>     HtmlSelectManyListbox selectedList;
> 
>     HtmlCommandButton addButton, addAllButton, removeButton,
> removeAllButton;
> 
> --
> Mariano G. Petrakovsky
> Programmer · Software Factory
> AXG Tecnonexo -  www.tecnonexo.com
> 
> Development facilities:Av. Maipú 1252 8º (C1006ACT) · Buenos Aires ·
> Argentina.
> Tel.: (54-11) 4878-0005 - Fax: (54-11) 4878-0065.
> 
> Headquarters: 1604 Spring Hill Road, Suite 160 Vienna · VA 22182 · USA.
> Tel.: (202) 986-7541 - Fax: (202) 787-3891.
> 
> 
> · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 
· ·
> · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 
· ·
> · · · ·
> 
> 
> -----Mensaje original-----
> De: news [mailto:news@sea.gmane.org]En nombre de Werner Punz
> Enviado el: Viernes, 01 de Julio de 2005 13:34
> Para: users@myfaces.apache.org
> Asunto: Re: New Component
> 
> 
> Hi Mariano, the best way to do this is to find a component which does
> most of the wanted functionality and then write a child class of the
> tag, the renderer and the component (if needed)
> 
> You can use UIComponent as a base, but you will save lots of work if you
> start with a more high level approach (Most components derive from
> something higher than UIComponent or UIInput)
> 
> For the ShuttleList a Panel or a Div might be a good starting point as a
> base because you need some kind of Panel Functionality anway.
> 
> Werner
> 
> 
> 
> Mariano Petrakovsky wrote:
> > After long time, I'm decide to create a custom component. :P
> >
> > I want to do a component like ShuttleList of ADF, Two 
SelectManyListBox,
> > four CommandButtons (Add, Add All, Remove, Remove All). The elements
> inside
> > Lists can move together Lists.
> >
> > My cuestion is... can extends an existent UIComponent to do this or... 
I
> > extends of UIComponent Class :(?
> > How think is the better mode to do this component? :)
> > Thanxs!!!
> >
> >
> 
> 
> 
> 

RE: New Component

Posted by Mariano Petrakovsky <mp...@tecnonexo.com>.
I define this Class... but I have a dude...
The two list inside of this Class... must be HtmlSelectManyListBox or
UISelectMany ?


public class HtmlShuttleList extends UIPanel {

    public static final String SHUTTLE_LIST_FAMILY = "SLFAMILY";

    HtmlSelectManyListbox validList;

    HtmlSelectManyListbox selectedList;

    HtmlCommandButton addButton, addAllButton, removeButton,
removeAllButton;

--
Mariano G. Petrakovsky
Programmer · Software Factory
AXG Tecnonexo -  www.tecnonexo.com

Development facilities:Av. Maipú 1252 8º (C1006ACT) · Buenos Aires ·
Argentina.
Tel.: (54-11) 4878-0005 - Fax: (54-11) 4878-0065.

Headquarters: 1604 Spring Hill Road, Suite 160 Vienna · VA 22182 · USA.
Tel.: (202) 986-7541 - Fax: (202) 787-3891.


· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
· · · ·


-----Mensaje original-----
De: news [mailto:news@sea.gmane.org]En nombre de Werner Punz
Enviado el: Viernes, 01 de Julio de 2005 13:34
Para: users@myfaces.apache.org
Asunto: Re: New Component


Hi Mariano, the best way to do this is to find a component which does
most of the wanted functionality and then write a child class of the
tag, the renderer and the component (if needed)

You can use UIComponent as a base, but you will save lots of work if you
start with a more high level approach (Most components derive from
something higher than UIComponent or UIInput)

For the ShuttleList a Panel or a Div might be a good starting point as a
base because you need some kind of Panel Functionality anway.

Werner



Mariano Petrakovsky wrote:
> After long time, I'm decide to create a custom component. :P
>
> I want to do a component like ShuttleList of ADF, Two SelectManyListBox,
> four CommandButtons (Add, Add All, Remove, Remove All). The elements
inside
> Lists can move together Lists.
>
> My cuestion is... can extends an existent UIComponent to do this or... I
> extends of UIComponent Class :(?
> How think is the better mode to do this component? :)
> Thanxs!!!
>
>





RE: New Component

Posted by Mariano Petrakovsky <mp...@tecnonexo.com>.
Thanxs Werner...

	I'm trying with a Panel... isn't so easy this work :P...

--
Mariano G. Petrakovsky
Programmer · Software Factory
AXG Tecnonexo -  www.tecnonexo.com

Development facilities:Av. Maipú 1252 8º (C1006ACT) · Buenos Aires ·
Argentina.
Tel.: (54-11) 4878-0005 - Fax: (54-11) 4878-0065.

Headquarters: 1604 Spring Hill Road, Suite 160 Vienna · VA 22182 · USA.
Tel.: (202) 986-7541 - Fax: (202) 787-3891.


· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
· · · ·


-----Mensaje original-----
De: news [mailto:news@sea.gmane.org]En nombre de Werner Punz
Enviado el: Viernes, 01 de Julio de 2005 13:34
Para: users@myfaces.apache.org
Asunto: Re: New Component


Hi Mariano, the best way to do this is to find a component which does
most of the wanted functionality and then write a child class of the
tag, the renderer and the component (if needed)

You can use UIComponent as a base, but you will save lots of work if you
start with a more high level approach (Most components derive from
something higher than UIComponent or UIInput)

For the ShuttleList a Panel or a Div might be a good starting point as a
base because you need some kind of Panel Functionality anway.

Werner



Mariano Petrakovsky wrote:
> After long time, I'm decide to create a custom component. :P
>
> I want to do a component like ShuttleList of ADF, Two SelectManyListBox,
> four CommandButtons (Add, Add All, Remove, Remove All). The elements
inside
> Lists can move together Lists.
>
> My cuestion is... can extends an existent UIComponent to do this or... I
> extends of UIComponent Class :(?
> How think is the better mode to do this component? :)
> Thanxs!!!
>
>





Re: New Component

Posted by Werner Punz <we...@gmx.at>.
Hi Mariano, the best way to do this is to find a component which does 
most of the wanted functionality and then write a child class of the 
tag, the renderer and the component (if needed)

You can use UIComponent as a base, but you will save lots of work if you
start with a more high level approach (Most components derive from 
something higher than UIComponent or UIInput)

For the ShuttleList a Panel or a Div might be a good starting point as a 
base because you need some kind of Panel Functionality anway.

Werner



Mariano Petrakovsky wrote:
> After long time, I'm decide to create a custom component. :P
> 
> I want to do a component like ShuttleList of ADF, Two SelectManyListBox,
> four CommandButtons (Add, Add All, Remove, Remove All). The elements inside
> Lists can move together Lists.
> 
> My cuestion is... can extends an existent UIComponent to do this or... I
> extends of UIComponent Class :(?
> How think is the better mode to do this component? :)
> Thanxs!!!
> 
>