Announcement

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

    Unable to add new record when list grid grouped by a column

    Hi,
    I'm unable to add a new record when list grid grouped by a particular column. Getting the following errors:
    Code:
    com.smartgwt.client.core.JsObject$SGWT_WARN: 15:18:13.309:KPR3:WARN:Log:Tree.add(): specified parent node:undef is not in the tree, returning
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        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:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
        at java.lang.Thread.run(Unknown Source)
    
    ***ERROR 2*****
    
    17:20:30.669 [ERROR] [bdtool] 17:20:30.635:IBLR2:WARN:ListGrid:isc_ListGrid_0:getCellRecord called with bad rowNum: undef
    
    com.smartgwt.client.core.JsObject$SGWT_WARN: 17:20:30.635:IBLR2:WARN:ListGrid:isc_ListGrid_0:getCellRecord called with bad rowNum: undef
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        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:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
        at java.lang.Thread.run(Unknown Source)
    Smart client version:
    SmartClient Version: v8.2p_2012-09-06/LGPL Development Only (built 2012-09-06)
    Browser: IE 8.0 and Firefox 11

    I'm able to reproduce this issue even with showcase example:
    http://www.smartclient.com/smartgwt/showcase/#grid_datatypes_text

    I've just modified GridDataTypesTextSample.java to add new record through UI using "Add New" button.

    PFA modified java file to reproduce this issue.

    I searched in this forum but couldn't find. Please suggest me if i'm doing wrong or any other property need to set to list grid to provide capability of adding new record when grouped?
    Attached Files

    #2
    Please let us know if this can be reproduced using the latest patched version (please don't report issues with older builds).

    Comment


      #3
      Hi Isomorphic,
      Thanks for the reply. I've tried with latest 3.1p version:
      SmartClient Version: v8.3p_2012-11-25/LGPL Development Only (built 2012-11-25)

      This time i'm getting different errors while adding record:
      Code:
      12:15:30.974 [ERROR] [bdtool] 12:15:30.981:KPR7:WARN:ListGrid:isc_ListGrid_0:Record:{countryName: "cd",
      capital: "ee",
      continent: "Asia"}, hidden in grouped tree data. Pending edits for this record will be maintained.
      
      com.smartgwt.client.core.JsObject$SGWT_WARN: 12:15:30.981:KPR7:WARN:ListGrid:isc_ListGrid_0:Record:{countryName: "cd",
      capital: "ee",
      continent: "Asia"}, hidden in grouped tree data. Pending edits for this record will be maintained.
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
          at java.lang.reflect.Constructor.newInstance(Unknown Source)
          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:172)
          at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
          at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
          at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
          at java.lang.Thread.run(Unknown Source)
      
      ***ERROR2***
      12:15:31.068 [ERROR] [bdtool] 12:15:31.010:IBLR8:WARN:ListGrid:isc_ListGrid_0:getCellRecord called with bad rowNum: undef
      
      com.smartgwt.client.core.JsObject$SGWT_WARN: 12:15:31.010:IBLR8:WARN:ListGrid:isc_ListGrid_0:getCellRecord called with bad rowNum: undef
          at sun.reflect.GeneratedConstructorAccessor19.newInstance(Unknown Source)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
          at java.lang.reflect.Constructor.newInstance(Unknown Source)
          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:172)
          at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
          at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
          at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
          at java.lang.Thread.run(Unknown Source)
      I've tried with 4.0d version but the issue exists there also.

      In UI, it is showing record as added. But in Dev console, i'm getting these errors and i'm not getting these newly added records when i call grid.getRecords() upon submission.

      Comment


        #4
        Those aren't errors, they are warnings.

        What they are telling you is that you've hidden a record that has pending edits. This is usually a bad idea, as the end user may lose track of them, and, by design, changes to hidden records are not saved if the user can see the record.

        Comment


          #5
          Hi Isomorphic,
          I dint get your point. When i grouped the grid by a column, continent, (using the followin code) by default it is displaying in collapsed mode.
          Code:
           countryGrid.setGroupByField("continent");
          So i just tried to add new record from UI. I tried by expanding the group as well. I saw same errors/warnings and finally i'm not getting those records.

          If this is warning, can this be ignored? If yes, i should get those records upon submission, right?

          Otherwise how can i achieve my requirement?

          Comment


            #6
            Hi,
            Any update on this? Is this not a valid use case ie., adding a record when listgrid grouped by a field?

            Comment


              #7
              We're having difficulty reproducing this as an actual bug.
              We tried adding this button to your example code:

              Code:
                      IButton btnShow=new IButton("Show Data");
                      btnShow.addClickHandler(new ClickHandler() {
                          
                          @Override
                          public void onClick(ClickEvent event) {
                              SC.say("There are now " + countryGrid.getRecords().length + " records.");
                          }
                      });
                      canvas.addMember(btnShow);
              If you load the app and click it, you see a warning indicating there are however many records countryData.getRecords() returns [15 in my test]. If you then click the "add" button, and populate with values / tab out, then click the "show" button again, you see the value correctly being incremented.

              Can you show us exactly how to reproduce the bug whereby the new records aren't being picked up?

              Note - we do see the warnings - they should be safe to ignore for this usage.

              Comment

              Working...
              X