Announcement

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

    Problem with ListGrid with Date and SelectItem in the filter bar

    Hi there! Thank you for the wonderful open source project!

    Either I am doing something wrong, or I've found a bug. I've attached a test case, which I've tried against the the Smart GWT 2.2 jar, and the latest nightly build, revision.1334 from here: http://www.smartclient.com/smartgwt/builds/

    I have a table with a custom DataSource and a filter bar. The filter bar has both a date picker and a select item. When I pull down the filter for the Select column, make a selection, and then apply the filter, my selection does not show up in the select item in the filter bar. I also get the following warning on my GWT Development Console:

    00:00:54.284 [ERROR] 10:37:15.230:TMR1:WARN:ListGrid:isc_ListGrid_0:Advanced criteria includes criteria for field:select with operator equals. Unable to display this type of criteria in the filter editor.

    Stack trace for this error is at end of message. If I remove the date field, the problem goes away. I've tried fiddling with the settings of the ListGridFields and the DataSourceFields, as well as those of the ListGrid, but I haven't found a combination that works.

    Any suggestions are most welcome!

    Thanks, John



    com.smartgwt.client.core.JsObject$SGWT_WARN: 10:37:15.230:TMR1:WARN:ListGrid:isc_ListGrid_0:Advanced criteria includes criteria for field:select with operator equals. Unable to display this type of criteria in the filter editor. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157) at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222) at java.lang.Thread.run(Thread.java:619)
    Attached Files

    #2
    Sorry for the garbled stack trace. Second try:

    Code:
    00:00:54.284 [ERROR] 10:37:15.230:TMR1:WARN:ListGrid:isc_ListGrid_0:Advanced criteria includes criteria for field:select with operator equals. Unable to display this type of criteria in the filter editor.
    com.smartgwt.client.core.JsObject$SGWT_WARN: 10:37:15.230:TMR1:WARN:ListGrid:isc_ListGrid_0:Advanced criteria includes criteria for field:select with operator equals. Unable to display this type of criteria in the filter editor.
     	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
     	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
     	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
     	at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
     	at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
     	at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
     	at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668)
     	at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401) 
    	at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
     	at java.lang.Thread.run(Thread.java:619)
    Last edited by sullymandias; 10 Aug 2010, 07:08.

    Comment


      #3
      Hi people,

      Any thoughts on this one? I've submitted a test case that seems to me to pretty clearly expose a SmartGWT bug. And no easy workaround. (I guess I could just turn off filtering for the select item column. If I turn off filtering for the date column, the problem persists.)

      Thanks!

      Best, John

      Comment


        #4
        Hi John,
        I think this is actually 2 separate issues on top of each other:
        Until recently we had a bug (or limitation) in ListGrid filterEditors whereby we weren't handling advanced criteria operators properly and would often show the error message you list out in your original report.
        This was actually fixed after 2.2, but (just) prior to the 1334 revision you also tested on.

        However there's another issue here too -- the dates in your example code are set up simply as new Date().
        SmartGWT date fields are always expected to contain logical date objects -- these are represented in Java (and Javascript by the underlying SC library) as native Date objects with the time set to zero (local timezone). When communicating with a server, these field values omit time information when they are serialized out for saving, and are created with a time of zero when parsing from server side data.
        In your example you're doing an exact match comparison between the date picked by the date-chooser field and the dates on the "date" field of the record -- but the record values have non zero times, which is confusing the comparitor function.
        If you modify your transformRequest code to set the times to zero in your test data - for example:
        Code:
        	                    Date d = new Date();
        	                    d.setTime(1281596400000L);
        	                    record.setAttribute("date",d);
        You should find the example working with recent nightly builds.

        Let us know if this doesn't seem to fix the issue for you

        Thanks
        Isomorphic Software

        Comment


          #5
          Isomorphic, 1334 LGPL release is the latest one in nightly build repository, which is from August 2nd. Did you stop building nightly builds for LGPL or I am missing something?
          Thanks.

          Comment


            #6
            You should be looking for nightly builds here.

            Sanjiv

            Comment


              #7
              Hi Isomorphic!

              Thanks so much for your reply. I will try what you suggest, and let you know how it goes. I might not be able to get to it until early next week.

              Best, John

              Comment


                #8
                A quick update on this - we've now resolved this gotcha in our source - when doing an "Equals" compare on a date type field, the time will now be ignored on the dates being looked at, so you should no longer need to zero out the time on your test data.

                Comment


                  #9
                  Hi Isomorphic,

                  I am trying to check out the latest source so I can try out your fix, but when I do:

                  svn checkout http://smartgwt.googlecode.com/svn/trunk/ smartgwt

                  I get:

                  svn: Server sent unexpected return value (502 Bad Gateway) in response to PROPFIND request for '/svn/!svn/vcc/default'

                  Am I doing something wrong? I am following the instructions from http://code.google.com/p/smartgwt/source/checkout

                  Thanks, John

                  Comment


                    #10
                    Originally posted by Isomorphic
                    However there's another issue here too -- the dates in your example code are set up simply as new Date().
                    SmartGWT date fields are always expected to contain logical date objects -- these are represented in Java (and Javascript by the underlying SC library) as native Date objects with the time set to zero (local timezone). When communicating with a server, these field values omit time information when they are serialized out for saving, and are created with a time of zero when parsing from server side data.
                    In your example you're doing an exact match comparison between the date picked by the date-chooser field and the dates on the "date" field of the record -- but the record values have non zero times, which is confusing the comparitor function.
                    If you modify your transformRequest code to set the times to zero in your test data - for example:
                    Code:
                    	                    Date d = new Date();
                    	                    d.setTime(1281596400000L);
                    	                    record.setAttribute("date",d);
                    You should find the example working with recent nightly builds.

                    Let us know if this doesn't seem to fix the issue for you
                    I tried making this change to the example I submitted, and I still get the same warning, and the contents select item in the filter are still getting blanked out. I adjusted the long literal to be a zero-time date in my time zone, and the problem did not go away.

                    I am still working from revision 1334, as this is the latest build from here:

                    http://www.smartclient.com/smartgwt/builds/

                    and I am not currently able to access the Subversion repository (see previous post).

                    Thanks! -John

                    Comment


                      #11
                      Hi John
                      Can you try the latest nightly from here: http://www.smartclient.com/builds/smartgwt-lgpl/

                      Thanks

                      Comment


                        #12
                        Originally posted by Isomorphic
                        Hi John
                        Can you try the latest nightly from here: http://www.smartclient.com/builds/smartgwt-lgpl/

                        Thanks
                        Fixed it! Thanks so much, you guys are great! Best, John

                        Comment


                          #13
                          1. Gwt2.1, SmartGwt 2.3 nightly 2010, Nov. 9., firefox 3.6.20 dev mode


                          This issue with loosing selection when press filter is still present if you have combobox and date fields; combobox looses selection and no more selections are not working on that filter.

                          Br//Marije

                          Comment


                            #14
                            Once again, smartclient.com/builds, not SVN, not any other URL.

                            Comment


                              #15
                              Yes, I am talking about those nightly builds.
                              They are not working.
                              Br// Marije

                              Comment

                              Working...
                              X