Hi,

changes to the tree in "processUpdates" will only affect when rendering
the same tree again.

This is normaly not the case, except of validation errors of case.

afaik the best place to modify existing components like this is (in jsf
1.1) in the encodeBegin() method. But you neet to check if the component
is already exists before adding it.

But if you create a custom component (or just a custom tag) you should
do things like this in the components constructor, or in case of tag in
doEndTag().

Regards,
  Volker

Martin Marinschek 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
> 

-- 
-------------------------------------------------------------------
    Volker Weber                       [EMAIL PROTECTED]
    Atanion GmbH                       http://www.atanion.com
    Bismarckstrasse 13                 Tel.: +49 441 4082 320
    26122 Oldenburg, Germany           Fax.: +49 441 4082 333

Reply via email to