Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-1419

GridView has a bug in findNext that prevents ReuseIfModelsEqualStrategy from working correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.3.1
    • 1.3.2
    • None
    • None

    Description

      the method findNext() in GridView.java has this code:

      if (cells != null && cells.hasNext())
      {
      next = (Item)cells.next();
      }

      but it should be:

      if (cells != null && cells.hasNext())
      {
      next = (Item)cells.next();
      return;
      }

      I have attached a quickstart project that will recreate the bug. When you hit the "toggle buggy" link, the panel should maintain its state and you should see the text toggle from "false" to "true". As you can see, it works correctly in the 1st column of panels, but the second column does not work.

      There is also a class called MyGridView in the attachment that fixes the issue.

      Attachments

        1. gridview-bug.tgz
          41 kB
          Ryan Dearing
        2. MyGridView.java
          7 kB
          Ryan Dearing

        Activity

          People

            ivaynberg Igor Vaynberg
            rdearing Ryan Dearing
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: