DisplayTag
  1. DisplayTag
  2. DISPL-320

Multiple group levels on column are broken

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1
    • Fix Version/s: 1.3
    • Component/s: None
    • Labels:
      None

      Description

      We have recently upgraded from 1.0 to 1.1 version of displaytag. Previously we could define column1 with group="1" and column2 with group="2" so that our grouping would have levels. When column1 changed groupings it would cause column2 to change, column2 could have multiple groupings for each group in column1.

      This is better explained in the displaytag reference doc for group:
      "The grouping level (starting at 1 and incrementing) of this column (indicates if successive contain the same values, then they should not be displayed). The level indicates that if a lower level no longer matches, then the matching for this higher level should start over as well. If this attribute is not included, then no grouping is performed."

      This behavior is broken in 1.1, as the levels are not respected. col2 is grouping even when col1 is not. Here is an attempt at an example:

      Correct 1.0 behavior:
      Col1 (group="1") Col2 (group="2")
      Omaha 50
      Omaha (50 here is hidden by grouping)
      Omaha 23
      Omaha 22
      Chicago 22 (22 here is shown because col1 changed values)
      Chicago (22 here is hidden by grouping)
      Chicago 42
      Chicago 43

      Incorrect behavior occurring in displaytag 1.1:
      Col1 (group="1") Col2 (group="2")
      Omaha 50
      Omaha (50 here is hidden by grouping)
      Omaha 23
      Omaha 22
      Chicago (22 here is incorrectly hidden even though col1 changed values)
      Chicago (22 here is hidden by grouping)
      Chicago 42
      Chicago 43
      1. differ and test files.rar
        3 kB
        tom li
      2. diffResults.txt
        1 kB
        Brad Alber
      3. TableWriterTemplate.java
        22 kB
        Brad Alber
      4. TableWriterTemplate-aynalem.java
        21 kB
        Matthew Aynalem

        Activity

        Hide
        Jeff Sheets added a comment -
        I want to fix my example a bit, as I forgot to hide the grouping in col1.... Here is the correct example of what is happening....

        Correct 1.0 behavior:
        Col1 (group="1") Col2 (group="2")
        Omaha 50
        (Omaha hidden) (50 here is hidden by grouping)
        (Omaha hidden) 23
        (Omaha hidden) 22
        Chicago 22 (22 here is shown because col1 changed values)
        (Chicago hidden) (22 here is hidden by grouping)
        (Chicago hidden) 42
        (Chicago hidden) 43

        Incorrect behavior occurring in displaytag 1.1:
        Col1 (group="1") Col2 (group="2")
        Omaha 50
        (Omaha hidden) (50 here is hidden by grouping)
        (Omaha hidden) 23
        (Omaha hidden) 22
        Chicago (22 here is incorrectly hidden even though col1 changed values)
        (Chicago hidden) (22 here is hidden by grouping)
        (Chicago hidden) 42
        (Chicago hidden) 43
        Show
        Jeff Sheets added a comment - I want to fix my example a bit, as I forgot to hide the grouping in col1.... Here is the correct example of what is happening.... Correct 1.0 behavior: Col1 (group="1") Col2 (group="2") Omaha 50 (Omaha hidden) (50 here is hidden by grouping) (Omaha hidden) 23 (Omaha hidden) 22 Chicago 22 (22 here is shown because col1 changed values) (Chicago hidden) (22 here is hidden by grouping) (Chicago hidden) 42 (Chicago hidden) 43 Incorrect behavior occurring in displaytag 1.1: Col1 (group="1") Col2 (group="2") Omaha 50 (Omaha hidden) (50 here is hidden by grouping) (Omaha hidden) 23 (Omaha hidden) 22 Chicago (22 here is incorrectly hidden even though col1 changed values) (Chicago hidden) (22 here is hidden by grouping) (Chicago hidden) 42 (Chicago hidden) 43
        Hide
        Fabio Grassi added a comment -
        I run into the same regression, and in my case it is too late to rollback to version 1.0 as I already modified nearly every page (tens of them) to use format and the new style of decorators. So this is a very big problem to me. I would very much appreciate a version 1.1.1 to be released soon!

        Thanks in advance, Fabio.
        Show
        Fabio Grassi added a comment - I run into the same regression, and in my case it is too late to rollback to version 1.0 as I already modified nearly every page (tens of them) to use format and the new style of decorators. So this is a very big problem to me. I would very much appreciate a version 1.1.1 to be released soon! Thanks in advance, Fabio.
        Hide
        Brad Alber added a comment -
        Here is a fix to the grouping problem. I don't have time to put together the docs and juint stuff right now. But I attached the soure and a diff.

        The fix makes a group start or group end span accross the whole row, rather than just the one column.

        Brad Alber
        Show
        Brad Alber added a comment - Here is a fix to the grouping problem. I don't have time to put together the docs and juint stuff right now. But I attached the soure and a diff. The fix makes a group start or group end span accross the whole row, rather than just the one column. Brad Alber
        Hide
        tom li added a comment -
        I attached my solution and differ files,hope it helps
        Show
        tom li added a comment - I attached my solution and differ files,hope it helps
        Hide
        Matthew Aynalem added a comment -
        The posted solutions would not work for me under v1.1.1. Here is the modified TableWriterTemplate class based on the v1.1.1 release src download that worked for me.
        i used the tests provided in the "differ and test files.rar".
        Solution could probably be fine tuned by someone with more time. but this should get the job done.

        note: some tests would in the v1.1.1 download. i disabled those tests to compile the jar.
        Show
        Matthew Aynalem added a comment - The posted solutions would not work for me under v1.1.1. Here is the modified TableWriterTemplate class based on the v1.1.1 release src download that worked for me. i used the tests provided in the "differ and test files.rar". Solution could probably be fine tuned by someone with more time. but this should get the job done. note: some tests would in the v1.1.1 download. i disabled those tests to compile the jar.
        Hide
        Blaine Simpson added a comment -
        The "Fix Version/s" field, and perhaps Status of this ticket seem to be wrong.
        You can see at http://displaytag.homeip.net/displaytag-examples-1.2/example-grouping.jsp that higher groups are indeed re-displaying when only the lower group changes. This example (example-grouping.jsp) unfortunately does not show lower groups changing without the higher group re-displaying, but I have tested this myself with 1.2 and that works too.
        (When I say "higher" group here, I mean the col. with the higher "group" value magnitude; not "higher" in a more intuitive "nesting" aspect. Higher groups under this stipulation are MORE nested = are at a LOWER/deeper nesting level.)

        I don't know whether it is also fixed in 1.1.1 or not, but that doesn't look hopeful based on previous comments to this ticket.
        Show
        Blaine Simpson added a comment - The "Fix Version/s" field, and perhaps Status of this ticket seem to be wrong. You can see at http://displaytag.homeip.net/displaytag-examples-1.2/example-grouping.jsp that higher groups are indeed re-displaying when only the lower group changes. This example (example-grouping.jsp) unfortunately does not show lower groups changing without the higher group re-displaying, but I have tested this myself with 1.2 and that works too. (When I say "higher" group here, I mean the col. with the higher "group" value magnitude; not "higher" in a more intuitive "nesting" aspect. Higher groups under this stipulation are MORE nested = are at a LOWER/deeper nesting level.) I don't know whether it is also fixed in 1.1.1 or not, but that doesn't look hopeful based on previous comments to this ticket.

          People

          • Reporter:
            Jeff Sheets
          • Votes:
            7 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated: