You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Petr Marek (JIRA)" <ta...@jakarta.apache.org> on 2006/03/01 09:29:24 UTC

[jira] Created: (TAPESTRY-872) Persitent page properties are not set before PageAttachListener#pageAttached method is fired

Persitent page properties are not set before PageAttachListener#pageAttached method is fired
--------------------------------------------------------------------------------------------

         Key: TAPESTRY-872
         URL: http://issues.apache.org/jira/browse/TAPESTRY-872
     Project: Tapestry
        Type: Bug
  Components: Web  
    Versions: 4.0    
 Environment: Windows 2000 Proffesional SP4
Apache Tomcat 4.1
Tapestry 4
    Reporter: Petr Marek


Persisten page property in pageAttached method is not set to stored property value before this listener is notified.It is set  after pageAttached is called, not before. It means property values stored in session can not be accesses in pageAttached method. If II understood specificaion correctly, it should be set before pageAttached is called. 

In javadoc specification for PageAttachListener#pageAttached(PageEvent event) it is written: 
"... Notifications occur after persistent page properties have been restored, but before the page is
 activated (if it is activated). ..."

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 even if value is stored to session
               String nameWithoutSession = this.getNameNoSession();
        }

         /**
         * Listener
         *  <at>  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");
        }
 }


 Petr Marek


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Updated: (TAPESTRY-872) Persitent page properties are not set before PageAttachListener#pageAttached method is fired

Posted by "Andreas Andreou (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-872?page=all ]

Andreas Andreou updated TAPESTRY-872:
-------------------------------------

    Component: Framework
                   (was: Web)

> Persitent page properties are not set before PageAttachListener#pageAttached method is fired
> --------------------------------------------------------------------------------------------
>
>          Key: TAPESTRY-872
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-872
>      Project: Tapestry
>         Type: Bug

>   Components: Framework
>     Versions: 4.0
>  Environment: Windows 2000 Proffesional SP4
> Apache Tomcat 4.1
> Tapestry 4
>     Reporter: Petr Marek

>
> Persisten page property in pageAttached method is not set to stored property value before this listener is notified.It is set  after pageAttached is called, not before. It means property values stored in session can not be accesses in pageAttached method. If II understood specificaion correctly, it should be set before pageAttached is called. 
> In javadoc specification for PageAttachListener#pageAttached(PageEvent event) it is written: 
> "... Notifications occur after persistent page properties have been restored, but before the page is
>  activated (if it is activated). ..."
> 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 even if value is stored to session
>                String nameWithoutSession = this.getNameNoSession();
>         }
>          /**
>          * Listener
>          *  <at>  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");
>         }
>  }
>  Petr Marek

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Updated: (TAPESTRY-872) Persitent page properties are not set before PageAttachListener#pageAttached method is fired

Posted by "Jesse Kuhnert (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-872?page=all ]

Jesse Kuhnert updated TAPESTRY-872:
-----------------------------------

    Fix Version/s: 4.1.2

> Persitent page properties are not set before PageAttachListener#pageAttached method is fired
> --------------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-872
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-872
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 4.0
>         Environment: Windows 2000 Proffesional SP4
> Apache Tomcat 4.1
> Tapestry 4
>            Reporter: Petr Marek
>             Fix For: 4.1.2
>
>
> Persisten page property in pageAttached method is not set to stored property value before this listener is notified.It is set  after pageAttached is called, not before. It means property values stored in session can not be accesses in pageAttached method. If II understood specificaion correctly, it should be set before pageAttached is called. 
> In javadoc specification for PageAttachListener#pageAttached(PageEvent event) it is written: 
> "... Notifications occur after persistent page properties have been restored, but before the page is
>  activated (if it is activated). ..."
> 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 even if value is stored to session
>                String nameWithoutSession = this.getNameNoSession();
>         }
>          /**
>          * Listener
>          *  <at>  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");
>         }
>  }
>  Petr Marek

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Resolved: (TAPESTRY-872) Persitent page properties are not set before PageAttachListener#pageAttached method is fired

Posted by "Jesse Kuhnert (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-872?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse Kuhnert resolved TAPESTRY-872.
------------------------------------

    Resolution: Fixed
      Assignee: Jesse Kuhnert

Yep you're right. Fixed. 

> Persitent page properties are not set before PageAttachListener#pageAttached method is fired
> --------------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-872
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-872
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 4.0
>         Environment: Windows 2000 Proffesional SP4
> Apache Tomcat 4.1
> Tapestry 4
>            Reporter: Petr Marek
>         Assigned To: Jesse Kuhnert
>             Fix For: 4.1.2
>
>
> Persisten page property in pageAttached method is not set to stored property value before this listener is notified.It is set  after pageAttached is called, not before. It means property values stored in session can not be accesses in pageAttached method. If II understood specificaion correctly, it should be set before pageAttached is called. 
> In javadoc specification for PageAttachListener#pageAttached(PageEvent event) it is written: 
> "... Notifications occur after persistent page properties have been restored, but before the page is
>  activated (if it is activated). ..."
> 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 even if value is stored to session
>                String nameWithoutSession = this.getNameNoSession();
>         }
>          /**
>          * Listener
>          *  <at>  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");
>         }
>  }
>  Petr Marek

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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