Announcement

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

    ListGrid and setGroupByField does not work

    Hello,
    i use the following configuration:

    SmartGWT 2.5 from 2011-04-28
    GWT 2.0.4
    IE8
    Jetty (Development mode)
    Tomcat (Production)

    and i have a following problem:

    I have a ListGrid and when I use the grouping (setGroupByField) in development mode, then it works, see Image_1, but if I build ".war"- file and deploy it to tomcat, it does not works, see Image_2.
    How can you explain it?

    Here is my samples:
    Code:
    List<ListGridField>	fields	= new ArrayList<ListGridField>();
    
    AsDS ds = new AsDS(baseNewDTO);
    ds.setID(artDerAs + "");
    
    ListGrid listGrid = new ListGrid();
    
    AAPListGridField asId = new AAPListGridField(AsDS.ASID, "ID", 35);
    fields.add(asId);
    
    AAPListGridField plz = new AAPListGridField(AsDS.ASPLZ, "PLZ", 40);
    fields.add(plz);
    
    AAPListGridField ort = new AAPListGridField(AsDS.ASORT, "Ort", 85);
    fields.add(ort);
    
    AAPListGridField kunde = new AAPListGridField(AsDS.KUNDE, "Kunde", 90);
    fields.add(kunde);
    
    AAPListGridField anzFZG = new AAPListGridField(AsDS.ANZFZG, "Stk.", 30);
    fields.add(anzFZG);
    
    AAPListGridField doppelte = new AAPListGridField(AsDS.DOPPELTE);
    fields.add(0, doppelte);
    
    this.listGrid.setGroupStartOpen(GroupStartOpen.ALL);
    this.listGrid.setGroupByField(AsDS.DOPPELTE);
    
    
    listGrid.setFields(fields.toArray(new ListGridField[fields.size()]));
    
    listGrid.setShowAllRecords(true);
    listGrid.setAutoFetchData(true);
    listGrid.setDataSource(ds);
    
    this.addMember(listGrid);
    Code:
    public class AsDS extends BaseDataSourceYB
    {
    	...........	
    
    	public AsDS(BaseNewDTO objektDTO)
    	{
    		super(objektDTO);
    		objektDTO.setName(OBJECT_NAME);
    		init();		
    	}
    
    	private void init()
    	{
    
    		DataSourceTextField baId = new DataSourceTextField(BEARBEITUNGSANGEBOTID);
    		baId.setPrimaryKey(true);
    		baId.setHidden(true);
    
    		DataSourceTextField asId = new DataSourceTextField(ASID);
    
    		DataSourceTextField asPlz = new DataSourceTextField(ASPLZ);
    
    		DataSourceTextField asOrt = new DataSourceTextField(ASORT);
    
    		DataSourceTextField asName = new DataSourceTextField(KUNDE);
    
    		DataSourceTextField anzahlFzg = new DataSourceTextField(ANZFZG);
    
    		DataSourceTextField doppelteId = new DataSourceTextField(DOPPELTE);
    
    		 setFields(doppelteId,baId,  asId, asPlz, asOrt, asName, anzahlFzg);
    
    	}
    }
    Attached Files

    #2
    Hi,

    I came accross your posting as I have the exact same problem. I opened a new Thread here:

    http://forums.smartclient.com/showthread.php?p=67321#post67321

    Did you solve the issue?

    Comment


      #3
      Since this is a completely browser-side behavior, you are going to find a difference in the files being deployed to the two environments once you look hard enough. Be sure to clear your browser cache as well.

      Comment


        #4
        Hi,

        I don't really understand the answer!

        Does that mean when I compile a SmartGWT project using ListGridField I get a different behavior then I had in the development mode?

        How can I debug/fix this?

        Comment


          #5
          Originally posted by sjackson
          Hi,

          I came accross your posting as I have the exact same problem. I opened a new Thread here:

          http://forums.smartclient.com/showthread.php?p=67321#post67321

          Did you solve the issue?
          No i did'nt solve the issue.

          Comment


            #6
            Originally posted by Isomorphic
            Since this is a completely browser-side behavior, you are going to find a difference in the files being deployed to the two environments once you look hard enough. Be sure to clear your browser cache as well.
            I've tried with cache, but it does not work anyway.

            Comment


              #7
              I played around a bit - this seems to be definitely a bug!

              If I set the column that I group by through the UI it works, but if I set it programatically I have the same behavior as shown in the screenshots!

              Comment


                #8
                To clarify again - somewhere in the .war file, there is a file that is different from what your are deploying to Jetty. Locate this file to find the problem. There's nothing that anyone can do to help until you've identified the differences between the two environments.

                Comment


                  #9
                  Sorry - I still don't get it -

                  The Development Mode does not compile to JS - so could you point out what I should compare against to?

                  Thanks!

                  Comment


                    #10
                    We thought you were comparing Jetty and Tomcat in compiled mode. If this is a development mode only bug, first try upgrading your GWT version (since this is basically a bug in GWT, not SmartGWT). If that still doesn't help, try other browsers and let us know where you see the problem.

                    Comment


                      #11
                      Hi!

                      There was a missunderstanding:

                      In the Development Mode everything works fine and as expected! When I compile and deploy the app in Tomcat I get the same behavior as described and shown in the screenshot by the first poster Unkis!

                      I updated now to the latest GWT version and I'm using SmartGWT 2.4 (also tried with a nightly build just in case).

                      I would appreciate suggestions to narrow down the problem to find a workaround!

                      I'm using SmartGWT grid pretty similar as the previous poster Unkis:

                      Global Variable
                      Code:
                      private ListGrid candidateGrid;

                      init() function:
                      Code:
                      candidateGrid = new ListGrid();
                      candidateGrid.setShowAllRecords(true);
                      candidateGrid.setShowEmptyMessage(false);
                      candidateGrid.setEmptyMessage("Loading...");
                      
                      candidateGrid.groupBy("CorrGroup");
                      candidateGrid.draw();
                      I assign the value for the "CorrGroup" field in the grid through a Prompt Windows programmatically (this code is in my event handler :

                      Code:
                      private ListGridRecord[] lastSelectionForNaming;
                      
                      myEventHandler() {
                      ...
                      lastSelectionForNaming = candidateGrid.getSelection();
                      ...
                      lastSelectionForNaming[i].setAttribute("CorrGroup", name);
                      ...
                      candidateGrid.groupBy("CorrGroup");
                      candidateGrid.redraw();
                      }

                      Comment


                        #12
                        This is a very small minority reporting this (just 2) and probably has something to do with bugs in GWT-RPC (not recommended; see FAQ). Try to put together a standalone test case that does not depend on GWT-RPC - if you can reproduce it there, we'll take a look. Otherwise, try to put together a test case involving GWT-RPC, which could be submitted to Google.

                        Comment


                          #13
                          Hi,

                          That was though. I tried to reproduce the problem and actually managed to create a project that shows the issue.

                          My first suspicion was that it has something to do with programatic grouping, then with RPC calls that are involved (as you pointed out) but finally I found out that I'm using a context menue and then a window to set the the group name.

                          To get a better understanding take a look at the attached screenshots!

                          The following RAR

                          Code:
                           http://hotfile.com/dl/121719736/d1cf939/SmartGWTProblem.rar.html
                          contains the eclipse project to reproduce the problem. I extended the GWT sample project - so its slim.

                          In Devlopment Mode it works as expected, but when compiled and deployed in Tomcat I have the previously described strange behavior.
                          Attached Files

                          Comment


                            #14
                            Thanks for taking the trouble to isolate this, but we don't need your whole test project, just a single .java file that can be dropped into one of the sample projects to reproduce the problem.

                            This also eliminates there being anything wrong with your project setup.

                            Comment


                              #15
                              Hi,

                              Here it comes !
                              Attached Files

                              Comment

                              Working...
                              X