Tapestry
  1. Tapestry
  2. TAPESTRY-1210

Problem with InlineEditBox on persisted page property

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.1
    • Fix Version/s: 4.1.2
    • Component/s: XHR/dhtml/Ajax
    • Labels:
      None

      Description

      I am using the component InlineEditBox, in Tapestry
      4.1.2 snapshot (dated 20 Dec 06),
      to edit a persisted (with session scope) property
      called description on page TestInlineEditBox.
      I have noticed the changes done to the property
      description is
      lost if I leave the page TestInlineEditBox and come
      back to it later.
      As the property description is persisted with scope
      session,
      In debug mode, I discovered that component.destroy (in InlineEditBox.script) is false.
      Consequently,
      dojo.event.connectOnce($

      {box}

      , "onSave",
      function(newValue, oldValue){
      tapestry.bind("$

      {component.updateUrl}

      ",
      {"$

      {component.clientId}

      ":newValue}, true);

      is not rendered.

      1. TestInlineEditBox.html
        0.7 kB
        Shing Hing Man
      2. TestInlineEditBox.java
        0.6 kB
        Shing Hing Man
      3. TestInlineEditBox.page
        0.2 kB
        Shing Hing Man

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        150d 32m 1 Jesse Kuhnert 20/May/07 21:06
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12569244 ] jira [ 12590498 ]
        Mark Thomas made changes -
        Workflow jira [ 12393016 ] Default workflow, editable Closed status [ 12569244 ]
        Jesse Kuhnert made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Jesse Kuhnert [ jkuhnert ]
        Resolution Fixed [ 1 ]
        Hide
        Jesse Kuhnert added a comment -

        Should render correctly in all situations now.

        Show
        Jesse Kuhnert added a comment - Should render correctly in all situations now.
        Jesse Kuhnert made changes -
        Fix Version/s 4.1.2 [ 12312202 ]
        Hide
        Shing Hing Man added a comment -

        After further debugging, it is found the ResponseBulider that renders
        the InlineEditBox in the above example is of type DefaultResponseBuilder.
        Consequently, the property component.destroy (set in method AbstractWidget.renderComponent())
        is false. In InlineEditbox.script, why do we need the 'if' statement in the following ?

        <if expression="component.destroy">
        dojo.event.connectOnce($

        {box}

        , "onSave", function(newValue, oldValue){
        tapestry.bind("$

        {component.updateUrl}

        ", {"$

        {component.clientId}

        ":newValue}, true);
        });
        </if>

        As it is, the InlineEditBox will not save the new value if it is rendered by a DefaultResponseBuilder.
        There is no such problem with the InlineEditBox in the Time Tracking example, because
        the InlineEditBox there is rendered by a DojoAjaxRepsonseBuilder (which sets component.destroy to true).

        Show
        Shing Hing Man added a comment - After further debugging, it is found the ResponseBulider that renders the InlineEditBox in the above example is of type DefaultResponseBuilder. Consequently, the property component.destroy (set in method AbstractWidget.renderComponent()) is false. In InlineEditbox.script, why do we need the 'if' statement in the following ? <if expression="component.destroy"> dojo.event.connectOnce($ {box} , "onSave", function(newValue, oldValue){ tapestry.bind("$ {component.updateUrl} ", {"$ {component.clientId} ":newValue}, true); }); </if> As it is, the InlineEditBox will not save the new value if it is rendered by a DefaultResponseBuilder. There is no such problem with the InlineEditBox in the Time Tracking example, because the InlineEditBox there is rendered by a DojoAjaxRepsonseBuilder (which sets component.destroy to true).
        Shing Hing Man made changes -
        Field Original Value New Value
        Attachment TestInlineEditBox.html [ 12347698 ]
        Attachment TestInlineEditBox.java [ 12347700 ]
        Attachment TestInlineEditBox.page [ 12347699 ]
        Hide
        Shing Hing Man added a comment -

        Source files of the example used.

        Show
        Shing Hing Man added a comment - Source files of the example used.
        Shing Hing Man created issue -

          People

          • Assignee:
            Jesse Kuhnert
            Reporter:
            Shing Hing Man
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development