Announcement

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

    Issue with expression filter on ListGrid

    Hello,
    I'm using Smartgwt 3.0 and SmartClient 8.2 and I have an issue when using expression filter on ListGrid.
    My apologies in advance if this bug is already fixed in a nightly build or already answer on this forum, I couldn't find it.

    The issue is that expression filters broke when used with large (means lots of columns) grid.

    Here is a simple code to reproduce the issue :
    Code:
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.data.DataSource;
    import com.smartgwt.client.data.Record;
    import com.smartgwt.client.data.fields.DataSourceIntegerField;
    import com.smartgwt.client.util.SC;
    import com.smartgwt.client.widgets.grid.ListGrid;
    import com.smartgwt.client.widgets.grid.ListGridField;
    import com.smartgwt.client.widgets.layout.HLayout;
    
    public class GridExpressionFilter implements EntryPoint {
    
    	static final int FIELDNUM = 60;
    	static final int RECORD_NUM = 100;
    
    	public void onModuleLoad() {
    		
    		SC.showConsole();
    		
    		final ListGrid listGrid = new ListGrid();
    		listGrid.setWidth(500);
    		listGrid.setHeight(300);
    		listGrid.setDataSource(new CustomDataSource());
    		ListGridField[] fields = new ListGridField[FIELDNUM + 1];
    		ListGridField id = new ListGridField("id", "id", 50);
    		fields[0] = id;
    		for (int i = 1; i <= FIELDNUM; i++) {
    			ListGridField field = new ListGridField("field" + i, "field" + i,
    					50);
    			fields[i] = field;
    		}
    		listGrid.setFields(fields);
    
    		listGrid.setAutoFetchData(true);
    		listGrid.setShowFilterEditor(true);
    		listGrid.setAllowFilterExpressions(true);
    
    		listGrid.draw();
    	}
    
    	private class CustomDataSource extends DataSource {
    		
    		public CustomDataSource() {
    			setID("customDataSrc");
    			DataSourceIntegerField[] fields = new DataSourceIntegerField[FIELDNUM + 1];
    			DataSourceIntegerField id = new DataSourceIntegerField("id");
    			id.setPrimaryKey(true);
    			fields[0] = id;
    			for (int i = 1; i <= FIELDNUM; i++) {
    				DataSourceIntegerField field = new DataSourceIntegerField(
    						"field" + i, "field" + i);
    				fields[i] = field;
    			}
    			Record[] records = new Record[RECORD_NUM];
    			for(int i = 0; i < RECORD_NUM; i ++) {
    				Record record = new Record();
    				record.setAttribute("id", i);
    				for (int j = 1; j <= FIELDNUM; j++) {
    					record.setAttribute("field" + j, i + j);
    				}
    				records[i] = record;
    			}
    			setFields(fields);
    			setClientOnly(true);
    			setTestData(records);
    		}
    	}
    }
    And here are the steps to reproduce :
    1) filter "field1" with the expression ">50"
    2) scroll to field50 and filter with expression "<60"
    => The grid is empty, and if scroll back to field1, the expression of the filter broken and is now "~>50"

    Looks like if scroll to a column no longer visible (or cached), the filter lost its property of expression and is changed to String.

    Reproduced on Ubuntu 11.10 on both Firefox 13 and chrome 21, dev mode and js compiled mode.

    Regards,
    Last edited by lleo; 15 Aug 2012, 20:18.

    #2
    We're experiencing the exact same problem.
    We're using SmartGWT 2.5 on some projects and SmartGWT 3.0 on other projects and we've reproduced the error in both cases.

    Can anyone suggest a workaround for this annoying issue?

    Thanks

    Comment


      #3
      Are you also seeing this only on Ubuntu?

      Does this reproduce for you with 3.1d?

      Comment


        #4
        I tested on Ubuntu 12 Firefox/Chrome, MacOSX Chrome/Firefox and Windows 7 Firefox.
        I also tested the SmartGWT 3.1d on Ubuntu 12/firefox and the issue is style here.

        As a workaround, I freeze the columns that I want to multi-filter.

        Comment


          #5
          We reproduced the bug on Windows XP and Windows 7, using IE8, Firefox and Chrome.
          Versions 2.5 and 3.0 as I said before, we haven't tried 3.1d but apparently the problem is still there.

          Freezing some columns and disabling the filters on all the other columns does indeed seem to work reliably, but this approach is not really satisfying: if we freeze too many columns there isn't much space left to show the rest of the data, and in any case we must limit the filtering possibilities of our users.

          Is there any workaround you can suggest us? Do you think this problem might be solved any time soon?

          Comment


            #6
            I have the same problem when filtering expression on ListGrid. Smartgwt 5.0p (06.05.2015) . Happening in any browser (IE9, Firefox23, Chrome 28 etc).
            The issue is that expression filters broke when used with large (means lots of columns) grid. If I filter after the last (buggy) shown field it gets the results and then another few filters appears after him but not all the filters.
            I have 100 columns to be filtered and all needed and a lot of large reports like this in a tree grid.

            I await your response or fix.
            Thanks!

            Razvan.

            Comment


              #7
              The first thing to do is upgrade to the latest nightly build from smartclient.com/builds - numerous fixes have been made to grid filtering in the several months since you got your current build.

              Comment


                #8
                I upgraded smartgwt to 23.10.2015 day build version 5.0 d and overridden that jar in my project. Still problem remains as I described upward. After 23 fields displayed correctly there nothing more to the rest of my 70 column report. My select is like : select 'field1' field1, 'field2' field2, ...up to 70 ... From dual. Any solutions?

                Comment


                  #9
                  We've tried the original test case against both 5.0 and 5.1 and do not show an issue.

                  You may either have mixed up something in your install (instructions in the FAQ show how to verify you are actually running a newly installed version), or your issue may not be the same as the original report. If you verify your update was successful but still have a problem, try creating a test case that replicates the problem.

                  Comment


                    #10
                    I observed that if the number of fields is maximum 15 the filters looks ok. If I increase the number of fields above 15 the filters above grid looks unaligned and incomplete.
                    Is there some limitation on maximum number of fields/columns ?

                    Comment


                      #11
                      We've made several attempts to reproduce the problem but are not seeing it. If you'd like us to investigate we'll need a complete test case. This should be minimal (just enough code to generate the component(s) required to see the problem) and runnable (not relying on external resources we don't have available, so we can just drop it into our dev env and reproduce the problem).

                      Thanks and regards
                      Isomorphic Software

                      Comment


                        #12
                        Problem: Filters are not shown correctly after scrolling horizontally (they are missaligned and ranged only above Field43)

                        Application is created using GWT 2.7.0 (WebAppCreator.cmd) and SmartGwt 5.1d (20.10.2015), browser Firefox 23 or Chrome 28.0.1500.71 m.

                        Test case:

                        public void onModuleLoad(){

                        body = new VLayout();
                        {
                        body.setWidth100();
                        body.setHeight100();
                        body.setLayoutMargin(5);
                        body.setMembersMargin(5);

                        }

                        ListGridField[] fields = new ListGridField[100];
                        for (int i = 0; i < 100; i++) {

                        ListGridField field = new ListGridField(i + "", "Field" + i);
                        field.setFilterOperator(OperatorId.EQUALS);
                        fields[i] = field;

                        }

                        Listgrid grid = new ListGrid();
                        grid.setFields(fields);
                        grid.setShowFilterEditor(true);
                        grid.setAutoWidthApproach(AutoFitApproach.BOTH);
                        grid.setAutoFitFieldWidths(true);
                        grid.setAutoFitFieldsFillViewport(true);
                        grid.setFields(fields);

                        body.addMember(grid);
                        body.draw();

                        }

                        Last edited by seiko777; 17 Nov 2015, 03:45.

                        Comment


                          #13
                          I forgot to mention java version 1.6.0_32, Windows 7, plugin ff_gwt-dev-plugin.xpi working on Firefox 23. The filters are still gibberish both in superdev mode and webmode. Please help!

                          Comment


                            #14
                            We took exactly this code, pasted it into a new project and tested it with various configurations.
                            It does not reproduce the problem.
                            There are a couple of typos in the above code - it wasn't runnable exactly as entered -- here's a version with the typo's fixed.
                            We'd recommend you try this version in your environment and see if the problem reproduces for you.

                            If it does, this might be a case where a screencast would help - there may be some subtlety in your interaction (how large your window is, how you are scrolling the viewport etc) which will allow us to reproduce the problem.

                            If it does not reproduce the problem with the attached code, please modify the test case to the point where it does reproduce the problem for you, and make sure it's a direct copy and paste from your source so we can actually drop it into an environment on our end and run it to see the problem. (A screencast might be useful here too)

                            Code:
                            import com.google.gwt.core.client.EntryPoint;
                            import com.smartgwt.client.types.AutoFitWidthApproach;
                            import com.smartgwt.client.types.OperatorId;
                            import com.smartgwt.client.widgets.grid.ListGrid;
                            import com.smartgwt.client.widgets.grid.ListGridField;
                            import com.smartgwt.client.widgets.layout.VLayout;
                            
                            public class MisalignedFilterEditors implements EntryPoint {
                            
                                public VLayout body;
                                public void onModuleLoad(){
                                    
                                    body = new VLayout();
                                    {
                                    body.setWidth100();
                                    body.setHeight100();
                                    body.setLayoutMargin(5);
                                    body.setMembersMargin(5);
                                    
                                    }
                                    
                                    ListGridField[] fields = new ListGridField[100];
                                    for (int i = 0; i < 100; i++) {
                                    
                                    ListGridField field = new ListGridField(i + "", "Field" + i);
                                    field.setFilterOperator(OperatorId.EQUALS);
                                    fields[i] = field;
                                    
                                    }
                                    
                                    ListGrid grid = new ListGrid();
                                    grid.setFields(fields);
                                    grid.setShowFilterEditor(true);
                                    grid.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
                                    grid.setAutoFitFieldWidths(true);
                                    grid.setAutoFitFieldsFillViewport(true);
                                    grid.setFields(fields);
                                    
                                    body.addMember(grid);
                                    body.draw();
                                
                                }
                            }
                            Thanks
                            Isomorphic Software

                            Comment


                              #15
                              I tried to make a new project with SmartGwt 5.1 and gwt 2.7.0 following examples of Hello word application from samples and inserting my above code (as entrypoint, in gwt.xml, configuring Dev mode and Web mode classes in Jdeveloper etc.). My sample application is starting ignoring my entryPoint (it shows nothing!).
                              Can you make me a working project with the code above (with java version 1.6.0_32, Windows 7 and Jdeveloper 10.1.3.5.0) , eventually a Jdeveloper 10.1.3.5.0 project, so I can test it?

                              Thanks in advance!


                              Comment

                              Working...
                              X