Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2269

Client persistence strategy does not detect changes to internal state of mutable objects

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.3.7
    • Fix Version/s: 5.4
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      Page:
      public class test {
      @Property
      @Persist(PersistenceConstants.CLIENT)
      Box u ; //any object here

      @Property
      @Persist(PersistenceConstants.CLIENT)
      private String title;

      public void setUpRender()

      { if(u==null) u = new Box(); }

      public void onSubmitFromTeast()

      { System.out.println("Submitted value="+u.getType()); }

      }

      tml:
      <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns="http://www.w3.org/1999/xhtml" xmlns="tapestry:parameter">
      <body>
      <t:form t:id="teast" id="teast" >
      <span>test</span>
      <p>
      <input t:type="textfield" t:value="u.type" t:clientId="utype"/>
      <!-<input t:type="textfield" t:value="title" />->
      </p>
      <input type="submit" />
      </t:form>
      </body>
      </html>

      Entity(The problem is not related to any particular entity. this can be any entity here):
      public class Box implements Serializable
      {
      public Long id;
      public String type;
      }

      In the test above, the persist doesn't work on Box object. If I just uncomment the 'title' textfield in tml, the persist on Box will be successful.

      I had a rough investigation and found ClientPersistentFieldStorageImpl.postChange was not triggered without the 'title' field.

        Attachments

        1. tptest.zip
          10 kB
          Rural Hunter

          Activity

            People

            • Assignee:
              hlship Howard M. Lewis Ship
              Reporter:
              ruralhunter Rural Hunter
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: