Thanks for the reply martin
processUpdates isn't called during the initial rendering of the
component.. I want to leave the selection of the country separate to
the component so users can hard code it or choose how the localization
is done..
the tag would look something like this.
<foo:inputBban country="EN" />
So users are free to set the value as they like
<foo:inputBban country="#{myBean.country}" />
I could hack it and do this when setCountry(String) is called on my
component, but seems dirty.. I assume that the JSF api has provision
for this initialization of a component to configure children base on
an attribute value..
I'll keep plugging away, but any input appeciated.
Mark
On 2/12/06, Martin Marinschek <[EMAIL PROTECTED]> wrote:
> Well, the tree is not expected to change during rendering in any case,
> so you are on dangerous ground here.
>
> That said, you might want to check out "processUpdates" for your
> purpose. At the end of "processUpdates" all value-changes have been
> processed, it might be the right location to change your component
> tree.
>
> regards,
>
> Martin
>
> On 2/12/06, Mark Lowe <[EMAIL PROTECTED]> wrote:
> > Okay
> >
> > I've decided to let the renderer do the work of rendering parent and
> > children. Moving on from that I'm having trouble understanding where I
> > want to add child components. Doing this in the renderer seems wrong
> > as I want to have different validators associated with components
> > depending on a which country the component is being created for..
> >
> > I want to do something like
> >
> > if("EN".equals(mycomponent.getCountry()) {
> > //add UIInputs according to this country.
> > }
> >
> > I'm just unsure which method in UIComponent I want to do this in.
> >
> > Mark
> >
> > On 2/11/06, Mark Lowe <[EMAIL PROTECTED]> wrote:
> > > Hello
> > >
> > > I'm forwarding this from my sent messages as sending to
> > > [email protected] appeared not to work.
> > >
> > > Mark
> > >
> > > ---------- Forwarded message ----------
> > > From: Mark Lowe <[EMAIL PROTECTED]>
> > > Date: Feb 11, 2006 12:43 PM
> > > Subject: Component advice
> > > To: MyFaces Discussion <[email protected]>
> > >
> > >
> > > Hello
> > >
> > > I'm writing a component that caters for internationalised bank account
> > > numbers. The idea is that the component renders different form
> > > elements and validates differently for different countries.
> > >
> > > I'm making decent progress, but during my faces component writing
> > > travels I've come across the following dilemma..
> > >
> > > To keep things tidy I've created a InputBban component that extends
> > > UIPanel, the Panel will that contain a InputBankCode and an
> > > InputAccountNumber component.. Now i could just render the lot in the
> > > Parent (InputBban), but should I really have a different renderer for
> > > each child and wire the parent to render the children?
> > >
> > > At the moment I'm doing everything in the Parent. I'm assuming that I
> > > wont need to use the children independently and that they will always
> > > be rendered as children of the parent (InputBban). Is this a good or
> > > bad thing to be doing?
> > >
> > > The other issue i could do with some help on is a tidy way to approach
> > > the rendering of different output and different validations for
> > > different countries. I guess its going to long whatever I do as the
> > > rules are going to be different between each country but any
> > > suggestions appeciated..
> > >
> > > Mark
> > >
> >
>
>
> --
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>