Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    List grid allowed to unselect all the listgrid columns.

    Hi,

    We are using Smart Gwt-4.1p (29th Oct 2014)
    Browser: Google chrome 39.0.2171.95 m, IE8 and IE9

    I have one listgrid which is having 3 columns(Col-A, Col-B and Col-C). All three columns are displayed(Visible) in the list grid.

    We have an option to un-select each column(Click on column header right corner >> Columns).But it is allowed me to un select all the columns(Col-A, Col-B and Col-C) and after unselected all the columns i have no option to revert back the changes.

    How to avoid un-selecting all the columns,
    In the above case if two columns(Col-A, Col-B) are un selected third column(Col-C) should not allow to un select and should be greyed out.

    Please let us know if any possibility is there to achieve the above behaviour.
    Thanks in Advance....

    Note: For you reference please find the attached screen shot.

    Regards,
    Attached Files

    #2
    We're not seeing this issue. When only one column remains, the built-in column picker menu shows the column name greyed out and it cannot be unselected. This behavior can be observed in many, many samples in the Showcase.

    Let us know if you can provide a minimal, standalone test case that reproduces the issue you're seeing.

    Comment


      #3
      Hi Isomorphic,

      Thank you for your replay,
      But still i am facing the issue. I created the sample code and sharing with you(Please find the attached files). Could you please check and let us know the fix possibility.

      Issue Reproduce Scenario:
      1. Open the window (after compiling attached code files).
      2. Un-select any one column on the listgrid(Right Click on Column Header >> Columns) and close the window with the help of "Close" button.
      3. Now refresh the page and make sure window opened.
      4. Now try to un-select all the columns.

      Result: Able to un-select all the columns in the list grid.

      Expected Results: When only one column remains, the built-in column picker menu should show the column name greyed out and it cannot be unselected.
      ----------------------------------------------
      We are using Smart Gwt-4.1p (29th Oct 2014)
      Browser: Google chrome 39.0.2171.95 m, IE8 and IE9
      ----------------------------------------------

      Thanks & Regards,
      Attached Files

      Comment


        #4
        We're still not seeing an issue.

        Please try updating to the latest patched build (or better yet, upgrade to 5.0, which you should plan to do soon anyway), then also make sure you have cleared any Offline state so that you are not using a viewState string from some previous test.

        If you still see a problem, please create a minimal test case - there's no apparent reason for the Window, custom DataSource, etc in this test code.

        Comment


          #5
          HI Isomorphic,

          Thank you for your reply,

          As per your suggestion, We checked this issue by downloading latest smartgwt nightly build ("Smart Gwt-4.1p (2015-02-28)") and still able to reproduce the issue.

          Sample test case is implemented and the source code files are attached.

          Steps To reproduce the issue using sample test application:
          1. Compile the code(Generate war file) and browse the page(Ex:http://127.0.0.1:8085/testsmartGwtProject/)
          2. Click on “Show” button.
          3. Make sure canvas with listgrid is opened.
          4. Unselect any one or two columns using “listgrid >>Columns” option.
          5. Now click on “Close” button.
          6. Repeat Step#2,3.
          7. Goto “ListGrid >> Columns” location.

          Result:
          Able to un-select all the columns.

          Expected Result:
          When only one column remains, the built-in column picker menu should show the column name greyed out and it cannot be unselected.

          Please let us know if there is any possibility to fix this issue.

          Info:
          1. Build : Smart Gwt-4.1p (2015-02-28)
          2. Browser: Google chrome 39.0.2171.95 m, IE8 and IE9

          Regards,
          Attached Files

          Comment


            #6
            As we previously explained:

            If you still see a problem, please create a minimal test case - there's no apparent reason for the Window, custom DataSource, etc in this test code.
            This test case still has lots of unnecessary code, and continues to depend on storing things in Offline storage, which means it still depends on the state on your individual workstation, which is probably why it failed to reproduce the bug for us last time.

            If there's a real bug here, you should be able to show that it can be reproduced with just one file and handful of lines of code, without depending on Offline storage at all. Try doing this and let us know if you succeed.

            Comment


              #7
              HI Isomorphic,

              Thank you for your reply,

              1. Actually i used "Offline storage" for maintaining the column state of the list grid(By default smartGWT not maintaining the state).
              2. I am facing this issue only if i set "setCanExpandRecords(true)" property on the list grid.
              3. As per your request, I created the sample test case and attached.
              4. As per my investigation this issue happening because of "setCanExpandRecords(true)" property.

              Please let me know if any possibility is there to fix this issue.

              Info:
              1. Build : Smart Gwt-4.1p (2015-02-28)
              2. Browser: Google chrome 39.0.2171.95 m, IE8 and IE9

              Regards,
              Attached Files

              Comment


                #8
                We understand why you're using Offline storage, however, it is not necessary to use it to build a test case, and the presence of a call to Offline storage means that we are unlikely to be able to reproduce the problem you claim, since it requires state stored on your individual workstation.

                So once again, please eliminate Offline storage from this test case if you want it to be looked at again - we already tried your previous test case, were not able to reproduce the problem, and strongly suspect this is because the test case relies on Offline storage.

                Comment


                  #9
                  Thank you for your replay,

                  But we want to use both "Offline storage" and "setCanExpandRecords(true) property " to maintain the column state.

                  Note: This issue is happening only if i use "Offline storage". But "Offline storage" is required to maintain the column state.

                  Is there any solution available to fix this issue please share the information.

                  Thank You

                  Comment


                    #10
                    It's fine that you intend to use Offline storage as part of your actual application.

                    However you must not use Offline storage as part of this *test case*, because it strongly implies that the test case will not reproduce the problem on any workstation but yours.

                    Another option would be to use Offline storage but make sure that there is no way you are retrieving stored state that only exists on your machine, for example, by storing under key names that are based on timestamps captured when the application is loaded. But again, the simplest thing is just to avoid use of the Offline system entirely for this specific test case.

                    Comment


                      #11
                      Hi Isomorphic,

                      Thank you for your reply,
                      1. As per your request i removed the "offline storage" from the test case and shared.(Please find the test case through attachments).
                      2. The reported issue occurred only if "Offline storage" and "setCanExpandRecords(true) property " are enabled.
                      3. Following code used to maintain the list grid column state

                      -----
                      public void applyFieldState() {
                      try {

                      final String viewState = (String) Offline.get(getId());
                      if (viewState != null) {
                      addDrawHandler(new DrawHandler() {
                      @Override
                      public void onDraw(DrawEvent event) {
                      // restore any previously saved view state for this grid
                      setViewState(viewState);
                      }
                      });
                      }
                      } catch (Exception e) {
                      e.printStackTrace();
                      }
                      FieldStateChangedHandler fieldStateChangedHandler = new FieldStateChangedHandler() {

                      @Override
                      public void onFieldStateChanged(FieldStateChangedEvent event) {
                      Offline.put(getId(), getViewState());
                      }
                      };
                      addFieldStateChangedHandler(fieldStateChangedHandler);
                      }

                      -----
                      4. Please let us know is there any possibility to maintain the list grid state(By default SMARTGWT not supported to maintain list grid column state) other than using "offline storage".


                      Info:
                      1. Build : Smart Gwt-4.1p (2015-02-28)
                      2. Browser: Google chrome 39.0.2171.95 m, IE8 and IE9

                      Regards,
                      Attached Files

                      Comment


                        #12
                        Hi vnathank,

                        please see this thread where I built a similar thing using the DB to persist the settings.

                        I also think that this as switch would be a good built-in functionality, perhaps like the Automatic Auditing feature (although I'm not too sure here, as I don't use that).
                        Same for persisted order Drag&Drop-reorderable ListGrids.

                        Best regards,
                        Blama

                        Comment


                          #13
                          Hi Blama,

                          Thanks for your reply,
                          Please check the detailed explanation of my issue:
                          Requirement:
                          1. Display inner listgrid for a listgrid(Note: This can be achieved by setting the property "setCanExpandRecords(true) " on the main list grid).
                          2. Maintain listgrid column state(Note: By default smatgwt does not have support so, Use offline storage).

                          Issue:
                          We are using inner list grid for a ListGrid. In this case, if I unselect all the columns from the menu item of a listGrid, then it is allowing to unselect all of them. But, according to the actual listGrid functionality when one column remains, then the built-in column picker menu should show the column name greyed out and it cannot be unselected.

                          Comment


                            #14
                            Originally posted by vnathank View Post
                            4. Please let us know is there any possibility to maintain the list grid state(By default SMARTGWT not supported to maintain list grid column state) other than using "offline storage".
                            I was talking about this, only. Although in a typical enterprise application it might really be better to use offline storage for this like you do, as you save DB-space and initial data transfer for the settings, as the user won't access the system from different systems/browsers.

                            Best regards,
                            Blama
                            Last edited by Blama; 18 Mar 2015, 03:43.

                            Comment


                              #15
                              Hi Isomorphic,

                              I checked this code in different workstations and able to reproduce.
                              1. There is no issue if only "Offline Store" is present.
                              2. Issue is exist if both "Offline Store" and "setCanExpandRecords(true) property " are enabled.
                              3. Again i simplified the code and shared through attachments.
                              4. Please let us know the possible solution to maintain the list grid column state.

                              Note:I enabled "setCanExpandRecords(true)" property for placing nested list grid inside listgrid.


                              Thanks in advanced.
                              Attached Files
                              Last edited by vnathank; 29 Sep 2015, 02:31.

                              Comment

                              Working...
                              X