You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jonathan O'Connor <Jo...@xcom.de> on 2004/12/21 13:33:33 UTC

RE: HOWTO PageBeginRender in a component [auf Viren geprueft]

Javier,
Just to save you some time. A couple of weeks ago, we were trying to 
initialize a component, but pageBeginRender is called before the component 
parameters are set up. This meant we could not read a record from the DB 
using the id passed as a parameter :-(

You have been warned!
Ciao,
Jonathan O'Connor
XCOM Dublin



"Filip Balas" <fb...@IMVProjects.com> 
20/12/2004 19:51
Please respond to
"Tapestry users" <ta...@jakarta.apache.org>


To
"Tapestry users" <ta...@jakarta.apache.org>, "Javier Sanchez" 
<ja...@gmail.com>
cc

Subject
RE: HOWTO PageBeginRender in a component [auf Viren geprueft]






Make the component implement the pagerenderlistener interface
and implement the pagebeginreder method:

public abstract class XX extends BaseComponent implements 
pageRenderListener {

  public void pageBeginRender(PageEvent event)
    {
      // PUT initialization code here
    }

   public void pageEndRender(PageEvent event)  {
                 super.pageEndRender(event);

                 IRequestCycle cycle=event.getRequestCycle();
        if (cycle.getEngine().
 getPageRecorder(cycle.getPage().getPageName(),cycle).isLocked())
                   return;

       setX(...);
       ....
  }

Filip



-----Original Message-----
From: Javier Sanchez [mailto:javierhsanchezm@gmail.com]
Sent: December 20, 2004 12:49 PM
To: tapestry-user@jakarta.apache.org
Subject: HOWTO PageBeginRender in a component


I am trying to initialize some component's properties (transient)
using something like this:

public abstract class XX extends BaseComponent {

   public void pageEndRender(PageEvent event)  {
                 super.pageEndRender(event);

                 IRequestCycle cycle=event.getRequestCycle();
        if (cycle.getEngine().
 getPageRecorder(cycle.getPage().getPageName(),cycle).isLocked())
                   return;

       setX(...);
       ....
  }

But nothing happens.  pageEndRender is never called.  Why?  How can I
do component's intializations if I do not have a pageBeginRender at
BaseComponent ?  In the above code, isLocked() is called
appropriately?

JAVIER S.

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org





*** XCOM AG Legal Disclaimer ***

Diese E-Mail einschlie?lich ihrer Anhange ist vertraulich und ist allein fur den Gebrauch durch den vorgesehenen Empfanger bestimmt. Dritten ist das Lesen, Verteilen oder Weiterleiten dieser E-Mail untersagt. Wir bitten, eine fehlgeleitete E-Mail unverzuglich vollstandig zu loschen und uns eine Nachricht zukommen zu lassen.

This email may contain material that is confidential and for the sole use of the intended recipient. Any review, distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.