Tapestry 5
  1. Tapestry 5
  2. TAP5-1896

AjaxFormLoop corrupts list when redisplayed after Remove then server-side failure

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Won't Fix
    • Affects Version/s: 5.3, 5.2
    • Fix Version/s: None
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      To see the effect use an AjaxFormLoop with input field(s) and at least 3 rows built from existing data. It must be in a Form.

      Remove row n.
      Submit, ensuring in some way that you get a server-side validation error.

      The redisplayed loop will have all the right output values, but the input values will be corrupted:

      • the removed row will be missing (good),
      • row n+1 will be correct (good),
      • every row below that will have input values that belong to the row before it (bad).

      If you try the process again but this time remove 2 adjacent rows you'll get:

      • the removed rows (n-1 and n) will be missing (good),
      • row n+1 will be correct (good),
      • row n+2 will be correct (good),
      • every row below that will have input values that belong 2 rows before it (bad).

        Issue Links

          Activity

          Geoff Callender created issue -
          Geoff Callender made changes -
          Field Original Value New Value
          Link This issue is part of TAP5-280 [ TAP5-280 ]
          Hide
          Geoff Callender added a comment -

          It seems to be that Form's Validation Tracker knows about added rows (thanks to the FormInjector?) but not removed rows - on redisplay it expects them to still be there.

          Show
          Geoff Callender added a comment - It seems to be that Form's Validation Tracker knows about added rows (thanks to the FormInjector?) but not removed rows - on redisplay it expects them to still be there.
          Hide
          George Christman added a comment -

          Geoff, do you know of a way to tell Validation Tracker the row has been removed?

          Show
          George Christman added a comment - Geoff, do you know of a way to tell Validation Tracker the row has been removed?
          Hide
          Geoff Callender added a comment -

          No idea, sorry. FormInjector might give some clues if it touches ValidationTracker.

          Show
          Geoff Callender added a comment - No idea, sorry. FormInjector might give some clues if it touches ValidationTracker.
          Hide
          Howard M. Lewis Ship added a comment -

          Unfortunately, Tapestry doesn't have enough information to handle cases of this complexity. AjaxFormLoop expects the data on the server side to be relatively stable. There simply isn't a way to encode all the data necessary to reconstruct the state.

          Tapestry is moving away from heavily stateful UIs based on AjaxFormLoop and friends; I suggest using Backbone or AngularJS for these situations. That sounds like a cop out, but it's really the way of the future.

          Show
          Howard M. Lewis Ship added a comment - Unfortunately, Tapestry doesn't have enough information to handle cases of this complexity. AjaxFormLoop expects the data on the server side to be relatively stable. There simply isn't a way to encode all the data necessary to reconstruct the state. Tapestry is moving away from heavily stateful UIs based on AjaxFormLoop and friends; I suggest using Backbone or AngularJS for these situations. That sounds like a cop out, but it's really the way of the future.
          Howard M. Lewis Ship made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Won't Fix [ 2 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Geoff Callender
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development