You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Petr Marek <Pe...@profinit.cz> on 2006/02/27 19:00:25 UTC

PageAttached method and persitent page properties

Hello,

please can anyone confirm me, if and how could be accessed persistent page 
property in PageAttachListener#pageAttached(PageEvent event) method?

In javadoc specification it is written "... Notifications occur after 
persistent page properties have been restored, but before the page is 
activated (if it is activated). ..."

I am not able to get persisten page property value in pageAttached method 
any way. It is all times null. It looks the property is filled by session 
value after pageAttached is called, not before. Can anyone confirm me, if 
I understood specificaion correctly? Eg. if can be value of persisten page 
property accesses in pageAttached method?

Here is simple example:

ZTest.page specification:
 
<page-specification class="ZTest">
    <property name="name" persist="session"/>
    <property name="nameNoSession"/>
</page-specification>

Asociated java class:

public abstract class ZTest extends BasePage implements PageAttachListener 
{
        public abstract String getName();
        public abstract void setName(String name);

        public abstract String getNameNoSession();
        public abstract void setNameNoSession(String nameWithoutSession);
 
        public void pageAttached(PageEvent event) {
                String name = this.getName(); // <-- here is returned null 
every time
                String nameWithoutSession = this.getNameNoSession();
        }
 
         /**
         * Listener
         * @ cycle
         */
        public void namelistener(IRequestCycle cycle) {
                String name = this.getName(); // <-- here is correctly 
returned value stored in session
                String nameWithoutSession = this.getNameNoSession();
 
                cycle.activate("Home");
        }
}

Thank you

Petr Marek

Re: PageAttached method and persitent page properties

Posted by Petr Marek <Pe...@profinit.cz>.
Thanks, good to know I am not alone. Can any of developers comment it 
here?

Regards

Petr Marek

"Daniel Lydiard" <dl...@hotmail.com> wrote on 27.02.2006 19:19:36:

> Yea I noticed the same thing for both persistent and non persistent 
> properties.


Re: PageAttached method and persitent page properties

Posted by Daniel Lydiard <dl...@hotmail.com>.
Yea I noticed the same thing for both persistent and non persistent 
properties.

----- Original Message ----- 
From: "Petr Marek" <Pe...@profinit.cz>
To: <ta...@jakarta.apache.org>
Sent: Monday, February 27, 2006 10:00 AM
Subject: PageAttached method and persitent page properties


> Hello,
>
> please can anyone confirm me, if and how could be accessed persistent page
> property in PageAttachListener#pageAttached(PageEvent event) method?
>
> In javadoc specification it is written "... Notifications occur after
> persistent page properties have been restored, but before the page is
> activated (if it is activated). ..."
>
> I am not able to get persisten page property value in pageAttached method
> any way. It is all times null. It looks the property is filled by session
> value after pageAttached is called, not before. Can anyone confirm me, if
> I understood specificaion correctly? Eg. if can be value of persisten page
> property accesses in pageAttached method?
>
> Here is simple example:
>
> ZTest.page specification:
>
> <page-specification class="ZTest">
>    <property name="name" persist="session"/>
>    <property name="nameNoSession"/>
> </page-specification>
>
> Asociated java class:
>
> public abstract class ZTest extends BasePage implements PageAttachListener
> {
>        public abstract String getName();
>        public abstract void setName(String name);
>
>        public abstract String getNameNoSession();
>        public abstract void setNameNoSession(String nameWithoutSession);
>
>        public void pageAttached(PageEvent event) {
>                String name = this.getName(); // <-- here is returned null
> every time
>                String nameWithoutSession = this.getNameNoSession();
>        }
>
>         /**
>         * Listener
>         * @ cycle
>         */
>        public void namelistener(IRequestCycle cycle) {
>                String name = this.getName(); // <-- here is correctly
> returned value stored in session
>                String nameWithoutSession = this.getNameNoSession();
>
>                cycle.activate("Home");
>        }
> }
>
> Thank you
>
> Petr Marek
> 

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