On 11/17/05, Mariano Petrakovsky <[EMAIL PROTECTED]> wrote:
Hi Craig... and what about Volker Weber post...?  
 
If I set rendered property false to a component in before render method, works now?
 
Thanxs ! :)

It depends on whether you are:

* Using JSP with the standard ViewController (which in JSF 1.1 builds
  the tree dynamically on the first pass through.).

* Redisplaying the same page, so that the component tree is already
  created.



Craig


--
Mariano G. Petrakovsky
Programmer · Software Factory
AXG Tecnonexo -  www.tecnonexo.com

Development facilities:Av. Maipú 1252 8º (C1006ACT) · Buenos Aires · Argentina.
Tel.: (54-11) 4878-0005 - Fax: (54-11) 4878-0065.

Headquarters: 1604 Spring Hill Road, Suite 160 Vienna · VA 22182 · USA.
Tel.: (202) 986-7541 - Fax: (202) 787-3891.


· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
 

-----Mensaje original-----
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]En nombre de Craig McClanahan
Enviado el: Jueves, 17 de Noviembre de 2005 15:01
Para: MyFaces Discussion
Asunto: Re: phase event...



On 11/17/05, Mariano Petrakovsky <[EMAIL PROTECTED]> wrote:
I have a table into database, with the ids of some fields in a page with a
boolean attribute  "visible".

My Jsf pages are all ready, then I need dynamically catch a phase before
render, look each component in this page an look in the database if this
field just be rendered.

I think i need put an phase listener... if is true... where I can read how
make this?

Yes, a phase listener is the strategy you'd want for this.  The basic idea would be to have the backing bean for your page register itself (probably in the constructor) as a phase listener for the Render Response phase, and then in the beforePhase() event handler you'd do the scan of components and set the "rendered" properties appropriately.  Don't forget to also deregister yourself as a listener (in the afterPhase() event method) to avoid memory leaks.

Or, just use Shale's ViewController API, and put your "check the database" code in the prerender() method.  Shale will do all the event listener wiring for you, so you don't have to.

    http://struts.apache.org/shale/

Craig


                                        Thanxs

--
Mariano G. Petrakovsky
Programmer · Software Factory
AXG Tecnonexo -  www.tecnonexo.com

Development facilities:Av. Maipú 1252 8º (C1006ACT) · Buenos Aires ·
Argentina.
Tel.: (54-11) 4878-0005 - Fax: (54-11) 4878-0065.

Headquarters: 1604 Spring Hill Road, Suite 160 Vienna · VA 22182 · USA.
Tel.: (202) 986-7541 - Fax: (202) 787-3891.


· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
· · · ·





Reply via email to