Announcement

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

    Getting console error while editing grid cell when used as the member of ValuesManager.

    Hi,
    I have used ValuesManager which includes multiple forms and 2 list grid as members. The values of the grid also gets submitted along with the form. Whenever i try to edit the cell of grid it throws below exception on console.

    I am using smartGWT version 6.1-p20170905.

    Uncaught TypeError: _2.contains is not a function
    at Object.isc_c_Canvas__performActionOnValue [as $833] (ISC_Core.js:3281)
    at Object.isc_c_Canvas__saveFieldValue [as $70n] (ISC_Core.js:3301)
    at _3.isc_ValuesManager__updateValue [as $10y] (ISC_Forms.js:2742)
    at _3.isc_ValuesManager__updateMultipleMemberValue [as $71e] (ISC_Forms.js:2737)
    at _3.isc_ListGrid__saveLocally [as $336] (ISC_Grids.js:2313)
    at _3.isc_ListGrid_saveEditedValues [as saveEditedValues] (ISC_Grids.js:2304)
    at _3.isc_ListGrid_saveEdits [as saveEdits] (ISC_Grids.js:2281)
    at _3.isc_ListGrid__saveAndHideEditor [as $33x] (ISC_Grids.js:2237)
    at _3.isc_ListGrid_cellEditEnd [as cellEditEnd] (ISC_Grids.js:2200)
    at _3.isc_ListGrid__handleClickOutsideEditor [as $32x] (ISC_Grids.js:2075)
    at eval (eval at isc__makeFunction (ISC_Core.js:79), <anonymous>:3:13)
    at _3.isc_c_Class_fireCallback [as fireCallback] (ISC_Core.js:306)
    at _3.isc_c_EventHandler__clickMaskClick [as $lj] (ISC_Core.js:1927)
    at _3.isc_c_EventHandler_clickMaskClick [as clickMaskClick] (ISC_Core.js:1925)
    at _3.isc_c_EventHandler_doHandleMouseDown [as doHandleMouseDown] (ISC_Core.js:1524)
    at _3.isc_c_EventHandler_handleMouseDown [as handleMouseDown] (ISC_Core.js:1519)
    at _3.isc_c_EventHandler_dispatch [as dispatch] (ISC_Core.js:1816)
    at HTMLDocument.eval (eval at isc__makeFunction (ISC_Core.js:79), <anonymous>:3:123)

    Thanks,
    Pulkit




    #2
    This somewhat suggests you've got some kind of invalid fieldName - possibly it has punctuation like a dot or slash, for example. FieldNames must be valid JavaScript identifiers.

    If you think this is actually an issue with our product, please show a minimal, ready-to-run test case demonstrating the issue.

    Comment


      #3
      Hi,
      Thanks for your suggestions.
      I have verified the field names and found it is valid. Problem is actually when the grid is used as the member of values manager.
      I have tried with new separate grid and it is not throwing any console error on editing the cell.
      Also in current code if i comment the line where i am adding grid as values manager member then it doesn't throw any console exception.

      Below is the code snippet for the same.

      private ValuesManager valManger;
      private ListGrid myListGrid;

      private void formUsingValuesManager() {
      valManger = new ValuesManager();

      myListGrid = createmyListGrid();
      valManger.addMember(myListGrid);

      DataSource dataSource = DataSource.get("myDatasource");
      valManger.setDataSource(dataSource);
      valManger.fetchData();
      }


      private ListGrid createmyListGrid() {
      ListGrid myListGrid = new ListGrid();
      myListGrid.setID("myListGridID");

      myListGrid.setEditEvent(ListGridEditEvent.CLICK);
      myListGrid.setFields(new ListGridField("field1", "column1"),
      new ListGridField("field2", "column2"));
      Validator validator = new Validator();
      validator.setType(ValidatorType.ISINTEGER);
      validator.setValidateOnChange(true);
      validator.setErrorMessage("Invalid Quantity, Please select valid Quantity to return");
      myListGrid.getField("field2").setCanEdit(Boolean.TRUE);
      myListGrid.getField("field2").setValidators(validator);
      myListGrid.getField("field2").setDefaultValue("0");
      myListGrid.setSaveLocally(Boolean.TRUE);
      return myListGrid;

      }

      Comment


        #4
        This code won’t reproduce the problem. Let us know if you can provide a minimal, ready-to-run test case demonstrating the problem.

        Note your approach of callers on that field after setFields() is invalid. Either move those calls before the setFields() call (which is far shorter), or use setFieldProperty() (the latter is mostly intended for after draw()).

        Comment


          #5
          Hi Isomorphic,

          I (not the OP) did not know about this possibility. Also, I don't see setFieldProperty() anywhere in the docs. Is it really available for use?

          Best regards
          Blama

          Comment


            #6
            Sorry, in SmartGWT it's plural so that you can have type safety via passing a partial ListGridField: setFieldProperties().

            Comment


              #7
              Ah, thanks. Did not know about this.

              Comment


                #8
                Hi,

                I have tried the caller approach before setFields() but it didn't work. You can reproduce this exception by simply adding list grid in any layout and this grid should be added as member of value manager.
                I have also tried by removing data source from value manager and added record in list grid explicitly. In this case also it gives exception on editing the cell value.

                Comment


                  #9
                  Hi
                  You can refer below code for test. This code throws the console exception but when i comment the last two statement(regarding value manager) then it works fine.
                  Please suggest.


                  public class MyEntryPoint implements EntryPoint {
                  private ValuesManager valManger;

                  public void onModuleLoad() {
                  ListGrid listGrid = new ListGrid();
                  listGrid.setID("listGridID");
                  ListGridField field1 = new ListGridField("column1", "column1");
                  ListGridField field2 = new ListGridField("column2", "column2");
                  ListGridField field3 = new ListGridField("column3", "column3");
                  listGrid.setFields(field1, field2, field3);
                  listGrid.setCanEdit(true);
                  listGrid.setEditEvent(ListGridEditEvent.CLICK);
                  listGrid.setEditByCell(true);
                  ListGridRecord[] recordArray = new ListGridRecord[1];
                  ListGridRecord record1 = new ListGridRecord();
                  record1.setAttribute("column1", 1);
                  record1.setAttribute("column2", 5);
                  record1.setAttribute("column3", 2);
                  recordArray[0] = record1;
                  listGrid.setRecords(recordArray);

                  listGrid.draw();

                  valManger = new ValuesManager();
                  valManger.addMember(listGrid);

                  }
                  }

                  Comment


                    #10
                    Hi,
                    Is there any update

                    Comment


                      #11
                      Hi Isomorphic

                      Gentle reminder about the requested query!

                      Comment


                        #12
                        Hello!
                        Yes - we have a developer working on this and will be following up soon

                        Regards
                        Isomorphic Software

                        Comment


                          #13
                          We've now made a change which should address this issue. Please try the next nightly build, dated Feb 4 or above

                          Regards
                          Isomorphic Software

                          Comment


                            #14
                            Thanks!

                            Comment

                            Working...
                            X