Announcement

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

    ListGrid viewState

    Is there any way to save the current filter data as part of the view state? If not, how would I go about doing this?

    #2
    It's not included in viewState, but getFilterEditorCriteria() allows you to get it and setCriteria() allows you to restore it, and it can be easily serialized to JSON via JSONEncoder.

    Comment


      #3
      Great thanks I'll try using those

      Comment


        #4
        Please run the attached testcase.
        Once loaded, sort the column "nReference - Select Field".
        Now click on the "Get View state button". This will print out the viewstate below. Note that the sortSpecifier is using the propert name as the field's displayField.


        Code:
        ({selected:"[]",field:"[{name:\"int_RBH\",width:null},{name:\"nRef_SF\",width:210},{name:\"cwPK__\",width:null}]",sort:"({fieldName:\"nRef_SF\",sortDir:\"ascending\",sortSpecifiers:[{property:\"nRef_SF$DF\",direction:\"ascending\",$78e:null}]})",hilite:null,group:""})
        Now, clear the sort and click on "Set view state with display field name". This is supposed to set the view state that we saw in step #1 but it does not. You see no visual change to the listgrid column.

        Now click "Set view state with actual field name". This button will attempt to set the same view state except with the following change:
        Code:
        sortSpecifiers:[{property:\"nRef_SF\",direction:\"ascending\",$78e:null}]
        You'll see that now the sorting has taken effect in the UI.

        Are we setting something that makes this happen? Is this a bug?
        Attached Files

        Comment


          #5
          This is working for us, regardless of which of the two buttons we use to reset the state. In both cases the UI updates to show the field in a sorted state (with sorted header icon and sorted data) after click.
          We have made a recent change somewhat in this area - it seems slightly unlikely to be related but would still be worth verifying. Please try the next nightly build (dated October 4 or greater) and see if you continue to experience this issue. If so let us know and we'll revisit in case we somehow missed something.

          Thanks
          Isomorphic Software

          Comment


            #6
            Sorry but this still does not work in the 8.2p branch with the latest build. It DOES WORK in 8.3 though but we cannot afford to move to 8.3 right now. We tried last week and ran into quite a bit of problems that we do not have time to look into before our next release. Please test with 8.2p. Thanks

            Comment


              #7
              Please do always post your build version and branch when reporting issues so we can be sure we're looking in the right place.

              We've now ported this fix back to 8.2p

              Regards
              Isomorphic Software

              Comment


                #8
                Ok. Thanks. The sample works but now we have a CRITICAL issue. We tried using today's build and we can no longer type into any textfield - even in your feature explorer.

                Comment


                  #9
                  This is a regression that has been fixed locally (this morning) but made it into the nightly build.
                  We caught this and have removed this particular set of builds from circulation (though of course - this is after you already picked up the bad version).

                  Sorry for the inconvenience. Rest assured that this will be fixed in the next nightly build.

                  Comment


                    #10
                    Hi,

                    we have another issue regarding to the view state. For the same example in this thread, if we click the "Set view state with display field name" button, the field is correctly sorted but "Table.sortField" or "Table.getSortField()" returns null. We are using "SmartClient_v82p_2012-10-09_PowerEdition".

                    We were tracking the "sortField" in our Selenium test cases. But they all failed now because Table.sortField always returns null even the fields are sorted. Can you please help? Should the "sortField" be null if we set the view state with display field name? Thanks!

                    Comment


                      #11
                      getSortField() only returns a field if the sort-field is visible.
                      In this case it's a little ambiguous - you're technically sorted by a field that isn't displayed (but of course the data is visible in another field due to the 'displayField' settings).
                      Internally we're looking at whether there's a better way to handle this.

                      Regardless - The best way for your application code to reliably figure out how the grid is currently sorted is to make use of the "getSort()" API.

                      Regards
                      Isomorphic Software

                      Comment

                      Working...
                      X