myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorge Vásquez>
Subject RE: Low level myFaces component maniulation...
Date Sat, 30 Sep 2006 23:58:52 GMT
Thanks Craig, 

Another question:  After finding a component how can I erase it from the
tree in order to force its “rebinding” during the RenderResponse phase.  


Jorge Vásquez 



De: [] En nombre de Craig
Enviado el: sábado, 30 de septiembre de 2006 18:12
Para: MyFaces Discussion
Asunto: Re: Low level myFaces component maniulation...



On 9/30/06, Jorge Vásquez <> wrote:


I have run into a very complex situation due to the fact that I use dynamic
includes in my application.  I need to change the whole component tree of an
include and I have found that the bound components inside an include are
processed in the RenderResponse phase (In case it helps I use myfaces
combined with facelets).  So I have tried all the alternatives that you can

1.  I created a listener that generated the components before the Render
Response but unfortunately the generated components weren´t bound to the
included page as the binding process in the included page took place during
the Render Response phase and not before.

2.  I decided to intercept somehow the binding process by introducing a
binding component for each included page that would act as a trigger to the
generation of the other components that were binded, but during this process
I discovered that the getters for a binding are only called once in the
history of that component and not for each cycle, and I was using a binding
getter as trigger.  I know this may sound quite confusing but my current
project´s nature is so complex to transmit these ideas just in one email.

I think that my new idea is to able to reset some elements of the component
tree related to the included pages to permit the trigger getter to be
invoked always and in this way be able to generate the tree composition for
the included page again.  

 Again, my main issue to simplify more my question is being able to clear
specific parts of a component tree (this demands for me to know where is
this tree kept in order to clear specific elements that I wish).  Can
somebody give  help me with a brief example of jsf component tree
manipulation or at least suggest me which are the classes involved in this

The root of the component tree can be retrieved like this:

    UIViewRoot root = FacesContext.getCurrentInstance ().getViewRoot();

>From there, you can walk the entire tree to find what you need, or perhaps
use the findComponent() method to locate a component based on its




Thanks a lot for your time,

Jorge Vásquez


View raw message