Announcement

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

    ListGrid: groups do no update anymore in case of new record added

    After updating to a more recent version of smartclient, the ListGrid does not show a new record after insert anymore in case a group field is defined.
    Update was for v8.3p Pro Deployment built 2012-09-16 to 2013-11-02.
    The ListGrid is initialized by "setGroupByField('fieldName")'" and the new record is added by calling "startEditingNew" (a JPA datsource is used).
    According the developper console, the cache is updated correctly, but there is a warning "MUP8:WARN:ResultSet:isc_ResultSet_0 (created by: isc_ListGrid_0):get: invalid index -1".
    The record addition works as expected if the grouping is disabled. If I manually group/regroup by hand the record is shown after insert too.
    Did I miss a change in the grouping concept of ListGrid?

    #2
    Please provide a way to reproduce the problem.

    Comment


      #3
      I observed the same and tried to explain it (with example code):

      http://forums.smartclient.com/showthread.php?t=28040

      Comment


        #4
        Simple example using a JPADatasource that worked with the "old" version:
        Code:
            Canvas canvas = new Canvas();  
                
                DataSource customerDS = DataSource.get("userJPA");
                
                final ListGrid userGrid = new ListGrid();
                userGrid.setID("userList"); 
                userGrid.setDataSource(customerDS);  
          
                ListGridField name = new ListGridField("name", "Name");    
                ListGridField code = new ListGridField("password", "Password");  
                userGrid.setFields(name, code);  
          
                userGrid.setAutoFetchData(true);  
                userGrid.setCanEdit(true);
                userGrid.setGroupByField("name");
                canvas.addChild(userGrid);  
          
                IButton button = new IButton("Edit New");  
                button.setTop(250);  
                button.addClickHandler(new ClickHandler() {  
                    public void onClick(ClickEvent event) {  
                        userGrid.startEditingNew();  
                    }  
                });  
                canvas.addChild(button);
        Code:
        <DataSource
            ID="userJPA"
            serverConstructor="com.isomorphic.jpa.JPA2DataSource"  
            beanClassName="User"  
            schemaBean="User" 
        >
            <fields>
            	<field name="id"   type="sequence" title="Id" primaryKey="true" canEdit="false"/> 
                <field name="name"   type="text"  title="Name" required="true"/> 
                <field name="password"   type="password" title="Password" required="true"/>                       
        </fields>
        </DataSource>
        The new record does not show up after insert.
        Last edited by daniel.bacher; 6 Nov 2013, 03:51.

        Comment


          #5
          The simple democase basically works with version v8.3p_2013-11-06/Pro Deployment (built 2013-11-06), thx.
          Unfortunately I get following new error:
          Code:
          18:42:29.509:XRP5:WARN:Log:TypeError: _9 is undefined
          Stack from error.stack:
              unnamed(isc_ListGrid__addRecordToGrou) @ serviceCare/sc/modules/ISC_Grids.js:2180
              unnamed(isc_ListGrid_regrou) @ serviceCare/sc/modules/ISC_Grids.js:2154
              unnamed(isc_ListGrid_dataChange) @ serviceCare/sc/modules/ISC_Grids.js:808
              unnamed(anonymou) @ serviceCare/sc/modules/ISC_Core.js:73
              unnamed(isc_ResultSet__doneChangingDat) @ serviceCare/sc/modules/ISC_DataBinding.js:1377
              unnamed(isc_ResultSet__handleNewDat) @ serviceCare/sc/modules/ISC_DataBinding.js:1340
              unnamed(isc.A.fetchRemoteDataRepl) @ serviceCare/sc/modules/ISC_DataBinding.js:1330
              unnamed(isc_c_Class_fireCallbac) @ serviceCare/sc/modules/ISC_Core.js:260
              unnamed(isc_Class_fireCallbac) @ serviceCare/sc/modules/ISC_Core.js:315
              unnamed(isc_DataSource_fireResponseCallback) @ serviceCare/sc/modules/ISC_DataBinding.js:639
              unnamed(isc_DataSource__completeResponseProcessin) @ serviceCare/sc/modules/ISC_DataBinding.js:637
              unnamed(isc_DataSource__handleSCServerRepl) @ serviceCare/sc/modules/ISC_DataBinding.js:1706
              unnamed(isc_c_Class_fireCallbac) @ serviceCare/sc/modules/ISC_Core.js:260
              unnamed(isc_Class_fireCallbac) @ serviceCare/sc/modules/ISC_Core.js:315
              unnamed(isc_c_RPCManager_fireReplyCallbac) @ serviceCare/sc/modules/ISC_DataBinding.js:1250
              unnamed(init_6/$wnd.isc.RPCManager.fireReplyCallbac) @ serviceCare/ADB0613968308B34C9FDCF20F03474CB.cache.html:23199
              unnamed(isc_c_RPCManager_fireReplyCallback) @ serviceCare/sc/modules/ISC_DataBinding.js:1253
              unnamed(isc_c_RPCManager_performOperationRepl) @ serviceCare/sc/modules/ISC_DataBinding.js:1250
              unnamed(isc_c_RPCManager__performTransactionRepl) @ serviceCare/sc/modules/ISC_DataBinding.js:1244
              unnamed(isc_c_RPCManager_performTransactionRepl) @ serviceCare/sc/modules/ISC_DataBinding.js:1210
              unnamed(anonymou) @ serviceCare/sc/modules/ISC_Core.js:67
              unnamed(isc_c_Class_fireCallbac) @ serviceCare/sc/modules/ISC_Core.js:260
              unnamed(isc_c_Comm_performXmlTransactionRepl) @ serviceCare/sc/modules/ISC_Core.js:944
              unnamed(anonymou) @ serviceCare/sc/modules/ISC_Core.js:67
              unnamed(isc_c_Class_fireCallbac) @ serviceCare/sc/modules/ISC_Core.js:260
              unnamed(isc_c_Comm__fireXMLCallbac) @ serviceCare/sc/modules/ISC_Core.js:926
              unnamed(isc_c_Comm_sendXmlHttpRequest/_1) @ serviceCare/sc/modules/ISC_Core.js:931
              unnamed() @

          Comment


            #6
            How do you reproduce this error? You said the simple case is fixed, can you show a test case that reproduces this error?

            Comment


              #7
              Using v8.3p_2013-11-16/Pro Deployment (built 2013-11-16) the above issue seems to be gone.
              Unfortunately using the above test case, the inline editing for grouped records seems to be broken.
              Setting the password field to type text and adding a new record, the newly created record does not update the value of the field after finish editing.
              The edit function for the new record works as expected if the grouping is disabled.

              Comment


                #8
                We've made a change which we think should address this issue. Please try the next nightly build (Nov 20 or above).

                If the problem persists, please let us know (and it probably makes sense to provide complete runnable test code plus steps to reproduce again, unless you're testing with exactly the test case already attached)

                Thanks and Regards
                Isomorphic Software

                Comment

                Working...
                X