You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Matthieu <be...@gmail.com> on 2010/12/14 10:23:22 UTC

JSF 1.2 custom component

Hi,

I am thinking of creating a component that would do the same job as a
h:inputText and a h:commandLink together into a form.
So i thought i could implement it that way:
In my renderer encodeBegin() function, i would add to the uiComponent given
as a parameter the two components i need, i-e inputText and commandLink.

but i'm not too sure of how the values i'll need will be put back where i
need them when the user will submit the form.
So, how do i make sure JSF or i can retrieve the value given to my children,
and put it back into the right field of my own custom component ?


PS: I could do a facelet but this leaves all CSS rules behind; and i wish
my css rules gets embedded in the header rather than in style attributes.
And i am stuck with JSF 1.2...

Re: JSF 1.2 custom component

Posted by Jakob Korherr <ja...@gmail.com>.
Hi,

You need to use the decode() method of the renderer of your component
to get the value into the component.

Maybe this [1] online tutorial for creating a JSF component can help
you (unfortunately it's in German only).

Regards,
Jakob

[1] http://jsfatwork.irian.at/semistatic/custom_component.html#!idx:/custom_component.html:5.2

2010/12/14 Matthieu <be...@gmail.com>:
> Hi,
>
> I am thinking of creating a component that would do the same job as a
> h:inputText and a h:commandLink together into a form.
> So i thought i could implement it that way:
> In my renderer encodeBegin() function, i would add to the uiComponent given
> as a parameter the two components i need, i-e inputText and commandLink.
>
> but i'm not too sure of how the values i'll need will be put back where i
> need them when the user will submit the form.
> So, how do i make sure JSF or i can retrieve the value given to my children,
> and put it back into the right field of my own custom component ?
>
>
> PS: I could do a facelet but this leaves all CSS rules behind; and i wish
> my css rules gets embedded in the header rather than in style attributes.
> And i am stuck with JSF 1.2...
>



-- 
Jakob Korherr

blog: http://www.jakobk.com
twitter: http://twitter.com/jakobkorherr
work: http://www.irian.at