You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chris Chiappone <ch...@gmail.com> on 2005/08/08 19:59:27 UTC

PageBeginRender question

It is true that the pageBeginRender method always gets called on page
creation correct?  The reason I'm asking is that I put a debug
statement in the method and only see it print the first time i visit
the page.  Subsequent visits to the page don't show the debug message.
-- 
~chris

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


Re: PageBeginRender question

Posted by Howard Lewis Ship <hl...@gmail.com>.
No; he seems to be using 3.0 code, not 4.0 code.  Both should work (in
4.0, PageRenderListener extends PageBeginRenderListener and
PageEndRenderListener).

You should only see beginRender() invoked when the page renders.  In
Tapestry terms, a form submission is considered a render.  You should
see it *every* time.

On 8/8/05, Jean-Yves Sironneau <jy...@fr.st> wrote:
> Maybe it's because you're using
> 
> PageRenderListener and not PageBeginRenderListener it seem's deprecated
> 
> Jean-Yves
> 
> 
> Chris Chiappone wrote:
> 
> >Ok I must be doing something wrong.  Maybe I'm just missing something
> >simple so I will include my code:
> >
> >public abstract class CompanyProfile extends ProtectedPage implements
> >PageRenderListener{
> >       private static Log log = LogFactory.getLog(CompanyProfile.class);
> >       private boolean appsExist;
> >       private boolean docsExist;
> >       public abstract Company getCompany();
> >       public abstract void setCompany(Company company);
> >       public abstract Users getUser();
> >       public abstract void setUser(Users user);
> >       public abstract List getAppList();
> >       public abstract void setAppList(List appList);
> >       public abstract Collection getDocList();
> >       public abstract void setDocList(Collection docList);
> >
> >       /* (non-Javadoc)
> >        * @see org.apache.tapestry.event.PageRenderListener#pageBeginRender(org.apache.tapestry.event.PageEvent)
> >        */
> >       public void pageBeginRender(PageEvent event) {
> >               log.info("\n\nRendering "+ getPage().getPageName() +"\n");
> >               if(getCompany() == null){
> >                       Visit v = (Visit) getVisit();
> >                       Company comp = v.getCurrentCompany();
> >                       setCompany(comp);
> >                       setUser(v.getCurrentUser());
> >               }
> >               Collection docs = getCompany().getDocuments();
> >               if(docs == null){
> >                       docs = new ArrayList();
> >               }
> >               setDocList(docs);
> >       }
> >
> >       /**
> >        * @return Returns the docsExist.
> >        */
> >       public boolean isDocsExist() {
> >               return(docsExist);
> >       }
> >
> >       /**
> >        * @param docsExist The docsExist to set.
> >        */
> >       public void setDocsExist(boolean docsExist) {
> >               this.docsExist = docsExist;
> >       }
> >//......
> >}
> >
> >Here is my page spec:
> >
> ><page-specification class="view.pages.CompanyProfile">
> >
> >    <description>Company Profile Page</description>
> >
> >    <property-specification name="company" type="domain.company.Company"/>
> >    <property-specification name="user" type="domain.useraccount.Users"/>
> >    <property-specification name="appList" type="java.util.List"/>
> >    <property-specification name="docList" type="java.util.Collection"/>
> >
> >    <component id="border" type="Border">
> >        <static-binding name="title">Company Profile</static-binding>
> >    </component>
> >
> >    <component id="docTable" type="DocumentTable">
> >        <binding name="docList" expression="docList"/>
> >    </component>
> >
> >    <component id="compInfo" type="CompanyInfo">
> >        <binding name="company" expression="company"/>
> >    </component>
> >
> >    <component id="apps" type="AppTable">
> >               <binding name="company" expression="company"/>
> >        <binding name="appList" expression="appList"/>
> >    </component>
> >
> ></page-specification>
> >
> >I also set this in the header:
> ><meta http-equiv="Expires" Content="-1"><meta
> >http-equiv="Cache-Control" Content="NO-CACHE"><meta
> >http-equiv="Pragma" Content="NO-CACHE">
> >So that the pages don't cache.
> >
> >Any thoughts??
> >
> >On 8/8/05, Mark Alcocer Flores <su...@yahoo.com> wrote:
> >
> >
> >>Maybe you miss implementing PageRenderListener!!!
> >>Why dont you check that?
> >>Mark.
> >>
> >>--- Chris Chiappone <ch...@gmail.com> wrote:
> >>
> >>
> >>
> >>>I am positive that its not being cached.  I can see some other output
> >>>in the logs associated with the page but do not see me debug for
> >>>pageBeginRender.  Also my initializations don't seem to be occuring
> >>>either.
> >>>
> >>>On 8/8/05, Greg Ward <gw...@python.net> wrote:
> >>>
> >>>
> >>>>On 08 August 2005, Chris Chiappone said:
> >>>>
> >>>>
> >>>>>So anytime i click on a link that implements PageRenderListener and I
> >>>>>have a debug message in pageBeginRender, this debug should show up
> >>>>>correct?
> >>>>>
> >>>>>public void pageBeginRender(PageEvent event){
> >>>>>   log.info("In pageBeginRender");
> >>>>>   // initialize some things....
> >>>>>
> >>>>>}
> >>>>>
> >>>>>I am only seeing the log message the first time I go to the page.  Is
> >>>>>there something I am doing wrong?
> >>>>>
> >>>>>
> >>>>Are you dead sure your browser isn't caching the page?  Use ethereal or
> >>>>tcpdump to sniff the connection and see what's really going over the wire.
> >>>>Or clear your browser's cache.
> >>>>
> >>>>       Greg
> >>>>
> >>>>---------------------------------------------------------------------
> >>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>>>
> >>>>
> >>>>
> >>>>
> >>>--
> >>>~chris
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>>
> >>>
> >>>
> >>>
> >>The Greatest Thing You'll Ever Learn
> >>It's Just To Love And Be Loved In Return
> >>
> >>
> >>---------------------------------------------------------------------
> >>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
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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


Re: PageBeginRender question

Posted by Jean-Yves Sironneau <jy...@fr.st>.
Maybe it's because you're using 

PageRenderListener and not PageBeginRenderListener it seem's deprecated

Jean-Yves


Chris Chiappone wrote:

>Ok I must be doing something wrong.  Maybe I'm just missing something
>simple so I will include my code:
>
>public abstract class CompanyProfile extends ProtectedPage implements
>PageRenderListener{
>	private static Log log = LogFactory.getLog(CompanyProfile.class);
>	private boolean appsExist;
>	private boolean docsExist;
>	public abstract Company getCompany();
>	public abstract void setCompany(Company company);
>	public abstract Users getUser();
>	public abstract void setUser(Users user);
>	public abstract List getAppList();
>	public abstract void setAppList(List appList);
>	public abstract Collection getDocList();
>	public abstract void setDocList(Collection docList);
>	
>	/* (non-Javadoc)
>	 * @see org.apache.tapestry.event.PageRenderListener#pageBeginRender(org.apache.tapestry.event.PageEvent)
>	 */
>	public void pageBeginRender(PageEvent event) {
>		log.info("\n\nRendering "+ getPage().getPageName() +"\n");
>		if(getCompany() == null){
>			Visit v = (Visit) getVisit();
>			Company comp = v.getCurrentCompany();
>			setCompany(comp);
>			setUser(v.getCurrentUser());
>		}
>		Collection docs = getCompany().getDocuments();
>		if(docs == null){
>			docs = new ArrayList();
>		}
>		setDocList(docs);
>	}
>	
>	/**
>	 * @return Returns the docsExist.
>	 */
>	public boolean isDocsExist() {
>		return(docsExist);
>	}
>
>	/**
>	 * @param docsExist The docsExist to set.
>	 */
>	public void setDocsExist(boolean docsExist) {
>		this.docsExist = docsExist;
>	}
>//......
>}
>
>Here is my page spec:
>
><page-specification class="view.pages.CompanyProfile">
>
>    <description>Company Profile Page</description>
>
>    <property-specification name="company" type="domain.company.Company"/>
>    <property-specification name="user" type="domain.useraccount.Users"/>
>    <property-specification name="appList" type="java.util.List"/>
>    <property-specification name="docList" type="java.util.Collection"/>
>    
>    <component id="border" type="Border">
>        <static-binding name="title">Company Profile</static-binding>
>    </component>
>    
>    <component id="docTable" type="DocumentTable">
>        <binding name="docList" expression="docList"/>
>    </component>
>    
>    <component id="compInfo" type="CompanyInfo">
>        <binding name="company" expression="company"/>
>    </component>
>    
>    <component id="apps" type="AppTable">
>   		<binding name="company" expression="company"/>
>        <binding name="appList" expression="appList"/>
>    </component>   
>    
></page-specification>
>
>I also set this in the header:
><meta http-equiv="Expires" Content="-1"><meta
>http-equiv="Cache-Control" Content="NO-CACHE"><meta
>http-equiv="Pragma" Content="NO-CACHE">
>So that the pages don't cache.
>
>Any thoughts??
>
>On 8/8/05, Mark Alcocer Flores <su...@yahoo.com> wrote:
>  
>
>>Maybe you miss implementing PageRenderListener!!!
>>Why dont you check that?
>>Mark.
>>
>>--- Chris Chiappone <ch...@gmail.com> wrote:
>>
>>    
>>
>>>I am positive that its not being cached.  I can see some other output
>>>in the logs associated with the page but do not see me debug for
>>>pageBeginRender.  Also my initializations don't seem to be occuring
>>>either.
>>>
>>>On 8/8/05, Greg Ward <gw...@python.net> wrote:
>>>      
>>>
>>>>On 08 August 2005, Chris Chiappone said:
>>>>        
>>>>
>>>>>So anytime i click on a link that implements PageRenderListener and I
>>>>>have a debug message in pageBeginRender, this debug should show up
>>>>>correct?
>>>>>
>>>>>public void pageBeginRender(PageEvent event){
>>>>>   log.info("In pageBeginRender");
>>>>>   // initialize some things....
>>>>>
>>>>>}
>>>>>
>>>>>I am only seeing the log message the first time I go to the page.  Is
>>>>>there something I am doing wrong?
>>>>>          
>>>>>
>>>>Are you dead sure your browser isn't caching the page?  Use ethereal or
>>>>tcpdump to sniff the connection and see what's really going over the wire.
>>>>Or clear your browser's cache.
>>>>
>>>>       Greg
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>>        
>>>>
>>>--
>>>~chris
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>      
>>>
>>The Greatest Thing You'll Ever Learn
>>It's Just To Love And Be Loved In Return
>>
>>
>>---------------------------------------------------------------------
>>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


Re: PageBeginRender question

Posted by Chris Chiappone <ch...@gmail.com>.
Ok I must be doing something wrong.  Maybe I'm just missing something
simple so I will include my code:

public abstract class CompanyProfile extends ProtectedPage implements
PageRenderListener{
	private static Log log = LogFactory.getLog(CompanyProfile.class);
	private boolean appsExist;
	private boolean docsExist;
	public abstract Company getCompany();
	public abstract void setCompany(Company company);
	public abstract Users getUser();
	public abstract void setUser(Users user);
	public abstract List getAppList();
	public abstract void setAppList(List appList);
	public abstract Collection getDocList();
	public abstract void setDocList(Collection docList);
	
	/* (non-Javadoc)
	 * @see org.apache.tapestry.event.PageRenderListener#pageBeginRender(org.apache.tapestry.event.PageEvent)
	 */
	public void pageBeginRender(PageEvent event) {
		log.info("\n\nRendering "+ getPage().getPageName() +"\n");
		if(getCompany() == null){
			Visit v = (Visit) getVisit();
			Company comp = v.getCurrentCompany();
			setCompany(comp);
			setUser(v.getCurrentUser());
		}
		Collection docs = getCompany().getDocuments();
		if(docs == null){
			docs = new ArrayList();
		}
		setDocList(docs);
	}
	
	/**
	 * @return Returns the docsExist.
	 */
	public boolean isDocsExist() {
		return(docsExist);
	}

	/**
	 * @param docsExist The docsExist to set.
	 */
	public void setDocsExist(boolean docsExist) {
		this.docsExist = docsExist;
	}
//......
}

Here is my page spec:

<page-specification class="view.pages.CompanyProfile">

    <description>Company Profile Page</description>

    <property-specification name="company" type="domain.company.Company"/>
    <property-specification name="user" type="domain.useraccount.Users"/>
    <property-specification name="appList" type="java.util.List"/>
    <property-specification name="docList" type="java.util.Collection"/>
    
    <component id="border" type="Border">
        <static-binding name="title">Company Profile</static-binding>
    </component>
    
    <component id="docTable" type="DocumentTable">
        <binding name="docList" expression="docList"/>
    </component>
    
    <component id="compInfo" type="CompanyInfo">
        <binding name="company" expression="company"/>
    </component>
    
    <component id="apps" type="AppTable">
   		<binding name="company" expression="company"/>
        <binding name="appList" expression="appList"/>
    </component>   
    
</page-specification>

I also set this in the header:
<meta http-equiv="Expires" Content="-1"><meta
http-equiv="Cache-Control" Content="NO-CACHE"><meta
http-equiv="Pragma" Content="NO-CACHE">
So that the pages don't cache.

Any thoughts??

On 8/8/05, Mark Alcocer Flores <su...@yahoo.com> wrote:
> Maybe you miss implementing PageRenderListener!!!
> Why dont you check that?
> Mark.
> 
> --- Chris Chiappone <ch...@gmail.com> wrote:
> 
> > I am positive that its not being cached.  I can see some other output
> > in the logs associated with the page but do not see me debug for
> > pageBeginRender.  Also my initializations don't seem to be occuring
> > either.
> >
> > On 8/8/05, Greg Ward <gw...@python.net> wrote:
> > > On 08 August 2005, Chris Chiappone said:
> > > > So anytime i click on a link that implements PageRenderListener and I
> > > > have a debug message in pageBeginRender, this debug should show up
> > > > correct?
> > > >
> > > > public void pageBeginRender(PageEvent event){
> > > >    log.info("In pageBeginRender");
> > > >    // initialize some things....
> > > >
> > > > }
> > > >
> > > > I am only seeing the log message the first time I go to the page.  Is
> > > > there something I am doing wrong?
> > >
> > > Are you dead sure your browser isn't caching the page?  Use ethereal or
> > > tcpdump to sniff the connection and see what's really going over the wire.
> > > Or clear your browser's cache.
> > >
> > >        Greg
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> > --
> > ~chris
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> 
> 
> The Greatest Thing You'll Ever Learn
> It's Just To Love And Be Loved In Return
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


-- 
~chris

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


Re: PageBeginRender question

Posted by Mark Alcocer Flores <su...@yahoo.com>.
Maybe you miss implementing PageRenderListener!!!
Why dont you check that?
Mark.

--- Chris Chiappone <ch...@gmail.com> wrote:

> I am positive that its not being cached.  I can see some other output
> in the logs associated with the page but do not see me debug for
> pageBeginRender.  Also my initializations don't seem to be occuring
> either.
> 
> On 8/8/05, Greg Ward <gw...@python.net> wrote:
> > On 08 August 2005, Chris Chiappone said:
> > > So anytime i click on a link that implements PageRenderListener and I
> > > have a debug message in pageBeginRender, this debug should show up
> > > correct?
> > >
> > > public void pageBeginRender(PageEvent event){
> > >    log.info("In pageBeginRender");
> > >    // initialize some things....
> > >
> > > }
> > >
> > > I am only seeing the log message the first time I go to the page.  Is
> > > there something I am doing wrong?
> > 
> > Are you dead sure your browser isn't caching the page?  Use ethereal or
> > tcpdump to sniff the connection and see what's really going over the wire.
> > Or clear your browser's cache.
> > 
> >        Greg
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > 
> > 
> 
> 
> -- 
> ~chris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


The Greatest Thing You'll Ever Learn
It's Just To Love And Be Loved In Return


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


Re: PageBeginRender question

Posted by Chris Chiappone <ch...@gmail.com>.
I am positive that its not being cached.  I can see some other output
in the logs associated with the page but do not see me debug for
pageBeginRender.  Also my initializations don't seem to be occuring
either.

On 8/8/05, Greg Ward <gw...@python.net> wrote:
> On 08 August 2005, Chris Chiappone said:
> > So anytime i click on a link that implements PageRenderListener and I
> > have a debug message in pageBeginRender, this debug should show up
> > correct?
> >
> > public void pageBeginRender(PageEvent event){
> >    log.info("In pageBeginRender");
> >    // initialize some things....
> >
> > }
> >
> > I am only seeing the log message the first time I go to the page.  Is
> > there something I am doing wrong?
> 
> Are you dead sure your browser isn't caching the page?  Use ethereal or
> tcpdump to sniff the connection and see what's really going over the wire.
> Or clear your browser's cache.
> 
>        Greg
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


-- 
~chris

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


Re: PageBeginRender question

Posted by Greg Ward <gw...@python.net>.
On 08 August 2005, Chris Chiappone said:
> So anytime i click on a link that implements PageRenderListener and I
> have a debug message in pageBeginRender, this debug should show up
> correct?
> 
> public void pageBeginRender(PageEvent event){
>    log.info("In pageBeginRender");
>    // initialize some things....
> 
> }
> 
> I am only seeing the log message the first time I go to the page.  Is
> there something I am doing wrong?

Are you dead sure your browser isn't caching the page?  Use ethereal or
tcpdump to sniff the connection and see what's really going over the wire.
Or clear your browser's cache.

        Greg

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


Re: PageBeginRender question

Posted by Chris Chiappone <ch...@gmail.com>.
So anytime i click on a link that implements PageRenderListener and I
have a debug message in pageBeginRender, this debug should show up
correct?

public void pageBeginRender(PageEvent event){
   log.info("In pageBeginRender");
   // initialize some things....

}

I am only seeing the log message the first time I go to the page.  Is
there something I am doing wrong?

~chris
On 8/8/05, Pablo Ruggia <pr...@gmail.com> wrote:
> pageBeginRender is called not only before creation. It get's called before
> any rendering (also before it starts rewinding).
> 
> On 8/8/05, Chris Chiappone <ch...@gmail.com> wrote:
> >
> > It is true that the pageBeginRender method always gets called on page
> > creation correct? The reason I'm asking is that I put a debug
> > statement in the method and only see it print the first time i visit
> > the page. Subsequent visits to the page don't show the debug message.
> > --
> > ~chris
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> 
> 


-- 
~chris

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


Re: PageBeginRender question

Posted by Pablo Ruggia <pr...@gmail.com>.
pageBeginRender is called not only before creation. It get's called before 
any rendering (also before it starts rewinding).

On 8/8/05, Chris Chiappone <ch...@gmail.com> wrote:
> 
> It is true that the pageBeginRender method always gets called on page
> creation correct? The reason I'm asking is that I put a debug
> statement in the method and only see it print the first time i visit
> the page. Subsequent visits to the page don't show the debug message.
> --
> ~chris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>