Tapestry
  1. Tapestry
  2. TAPESTRY-872

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

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.1.2
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Windows 2000 Proffesional SP4
      Apache Tomcat 4.1
      Tapestry 4

      Description

      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

        Activity

        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12567482 ] jira [ 12590483 ]
        Mark Thomas made changes -
        Workflow jira [ 12351354 ] Default workflow, editable Closed status [ 12567482 ]
        Jesse Kuhnert made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Assignee Jesse Kuhnert [ jkuhnert ]
        Hide
        Jesse Kuhnert added a comment -

        Yep you're right. Fixed.

        Show
        Jesse Kuhnert added a comment - Yep you're right. Fixed.
        Jesse Kuhnert made changes -
        Fix Version/s 4.1.2 [ 12312202 ]
        Andreas Andreou made changes -
        Field Original Value New Value
        Component/s Framework [ 11280 ]
        Component/s Web [ 11285 ]
        Petr Marek created issue -

          People

          • Assignee:
            Jesse Kuhnert
            Reporter:
            Petr Marek
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development