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
>

Reply via email to