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

----- Original Message ----- From: "Petr Marek" <[EMAIL PROTECTED]>
To: <[email protected]>
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to