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

        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.
        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).
        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.

          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