swingx
  1. swingx
  2. SWINGX-1422

JXTable.setColumnSequence() works incorrectly as of 1.6.2, possibly earlier

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.6.2
    • Fix Version/s: 1.6.3
    • Component/s: Table
    • Labels:
      None
    • Environment:

      Environment independent: happens on Windows XP, Mac OSX, Windows 7 with a variety of JREs (observed in 1.6_17 thru 1.6_24).

      Description

      Our application's JXTable "state saving" is broken as of swingx 1.6.2. Before this release, our users could save the visibility of columns (among other things). Now this no longer works. If you run the attached program, simply hide one of the columns using JXTable's column control popup and click on "Get State". This extracts the column-related information from the JXTable. Now use the column control popup to make the column visible again. If you click on "Set State Column Sequence", the previously saved state gets restored, so the column you previously hid should disappear again- but it doesn't....at least not with swingx 1.6.2. The problem appears to be the JXTable.setColumnSequence() call. If we leave that out (in the test program, click the "Set State No Column Sequence", the column does disappear as expected. Unfortunately, that's not a good workaround as we're also trying to save/restore column order as part of our state.

        Issue Links

          Activity

          Hide
          kleopatra added a comment -

          Tom,

          hmm ... did that ever work?

          Because, on first look it seems to be a mis-usage of the setColumnSequence: what it is intended to do is to change the initial insertion order (which by default is the same as the sequence in the model). As you noted, there is no api to restore user order of columns, you have to do it yourself. See XProperties in my incubator.

          That said, I'm puzzled about the visible/hidden property - shouldn't be touched in setColumnSequence. Need to dig a bit

          Thanks
          Jeanette

          Show
          kleopatra added a comment - Tom, hmm ... did that ever work? Because, on first look it seems to be a mis-usage of the setColumnSequence: what it is intended to do is to change the initial insertion order (which by default is the same as the sequence in the model). As you noted, there is no api to restore user order of columns, you have to do it yourself. See XProperties in my incubator. That said, I'm puzzled about the visible/hidden property - shouldn't be touched in setColumnSequence. Need to dig a bit Thanks Jeanette
          Hide
          tjwolf added a comment -

          Hi Jeanette,
          Yes, this used to work - at least in 0.9x. Both I and Wolfgang (Jyloo - maker of Synthetica) verified it (Jyloo deploys swingx with their Synthetica Add-ons, so I asked him which version of swingx they had been using prior to 1.6.2 - he said it was 0.9 or 1.0).

          If you don't have a 0.9x release handy and want to try with the above test case, I could attach the jar to this issue.

          Thanks for looking into it. If you can think of an easy workaround (or the "proper" way to restore user column order), let me know.

          Show
          tjwolf added a comment - Hi Jeanette, Yes, this used to work - at least in 0.9x. Both I and Wolfgang (Jyloo - maker of Synthetica) verified it (Jyloo deploys swingx with their Synthetica Add-ons, so I asked him which version of swingx they had been using prior to 1.6.2 - he said it was 0.9 or 1.0). If you don't have a 0.9x release handy and want to try with the above test case, I could attach the jar to this issue. Thanks for looking into it. If you can think of an easy workaround (or the "proper" way to restore user column order), let me know.
          Hide
          kleopatra added a comment -

          Tom,

          the underlying issue was #1423 (see the depends on link). That was indeed changed after 1.0, fixed now. Your example is working as far as the hidden column is concerned, but probably not doing what you expect: as I already said, the setColumnSequence is meant to change the insertion order of the columns, which is the same as shown in the column control. Don't use the method if you only intend to change the visual order of the columns. See XProperties on a how-to.

          Will close this as fixed in a while - waiting for your objection, if any

          Cheers
          Jeanette

          Show
          kleopatra added a comment - Tom, the underlying issue was #1423 (see the depends on link). That was indeed changed after 1.0, fixed now. Your example is working as far as the hidden column is concerned, but probably not doing what you expect: as I already said, the setColumnSequence is meant to change the insertion order of the columns, which is the same as shown in the column control. Don't use the method if you only intend to change the visual order of the columns. See XProperties on a how-to. Will close this as fixed in a while - waiting for your objection, if any Cheers Jeanette
          Hide
          tjwolf added a comment -

          Jeanette,
          Thanks for fixing the visibility thing so quickly. Not sure I understand your suggestion to look at XProperties on a how-to: can you provide a link? Will it show the "proper" way of saving/restoring visual order of the columns?

          I imagine your swingx-1423 fix will be in 1.6.3? When is that due out?

          Thanks as always,
          Tom

          Show
          tjwolf added a comment - Jeanette, Thanks for fixing the visibility thing so quickly. Not sure I understand your suggestion to look at XProperties on a how-to: can you provide a link? Will it show the "proper" way of saving/restoring visual order of the columns? I imagine your swingx-1423 fix will be in 1.6.3? When is that due out? Thanks as always, Tom
          Hide
          kleopatra added a comment -

          Tom,

          XProperties are in my incubator section, in the application package. Unsupported, as everything there The main thingy to keep in mind is the insertion vs. the visual sequence: the former is assumed to be kind of "fixed" (aka: generated by add/removeColumn). The latter is the user customization, it's generated from the former (by the user) by invoking moveColumn. On storing, you'll have to store that visual index along with the other properties. On restoring, there's no way (none that I'm aware of) but actually call moveColumn until you get the old user sequence.

          That's ugly .. feel free to file a rfe Closing this as fixed.

          Cheers
          Jeanette

          PS: no concrete plans for the next release

          Show
          kleopatra added a comment - Tom, XProperties are in my incubator section, in the application package. Unsupported, as everything there The main thingy to keep in mind is the insertion vs. the visual sequence: the former is assumed to be kind of "fixed" (aka: generated by add/removeColumn). The latter is the user customization, it's generated from the former (by the user) by invoking moveColumn. On storing, you'll have to store that visual index along with the other properties. On restoring, there's no way (none that I'm aware of) but actually call moveColumn until you get the old user sequence. That's ugly .. feel free to file a rfe Closing this as fixed. Cheers Jeanette PS: no concrete plans for the next release

            People

            • Assignee:
              kleopatra
              Reporter:
              tjwolf
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: