DisplayTag

Table displays incorrectly when a non-PaginatedList is provided after it was previously displayed with a PaginatedList

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.1
  • Fix Version/s: None
  • Component/s: Paging/Sorting
  • Labels:
    None
  • Application server:
    Tomcat 5.5.9

Description

In our application, sometimes we provide PaginatedList instances to DisplayTag, and sometimes we don't. So depending on the action, the same table might be displaying a PaginatedList or a simple List.

To reproduce the problem, follow these steps in the same session:

1) Display table providing a simple List. It should work as expected.
2) Display the same table providing a PaginatedList. It should work as expected.
3) Display the same table providing a simple List. The results will NOT be what you expect. Rows from the previous step (2) will be visible.

The problem seems to be that the reference to the PaginatedList is not released. The code that seems to be causing this is on TableTag.java, line 855.

        if (this.list instanceof PaginatedList)
        {
            this.paginatedList = (PaginatedList) this.list;
            this.list = this.paginatedList.getList();
        }

When the list is NOT a PaginatedList, the reference is not released, and the sole presence of a reference is what triggers the unexpected behaviour. The fix I propose (tested and seems to work fine) is:

        if (this.list instanceof PaginatedList)
        {
            this.paginatedList = (PaginatedList) this.list;
            this.list = this.paginatedList.getList();
        } else {
         this.paginatedList = null;
        }

Activity

Hide
Jamie Taylor added a comment -
The change suggested in this issue is included in the patch that I attached to DISPL-383.
Show
Jamie Taylor added a comment - The change suggested in this issue is included in the patch that I attached to DISPL-383.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:

Time Tracking

Estimated:
30m
Original Estimate - 30 minutes
Remaining:
30m
Remaining Estimate - 30 minutes
Logged:
Not Specified
Time Spent - Not Specified