Announcement

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

    Incorrect value in localeInt field breaks grid

    Hi,

    SmartGwt Power build 17´th August 2014.

    I have an editable grid where one of the fields is a integer that is localised, i.e the field type is localeInt.

    When I change the value of the localeInt field to something illegal, i.e. a character, something breaks. I correctly get a validation error, however, I´m not able to change the incorrectly entered value.

    I also get the following message in the development console:
    Code:
    [ERROR] [test] - 14:39:01.840:IFCS6:WARN:ListGrid:isc_ListGrid_0:suppressing editorEnter handlers on focus as listGrid.$30a is null
    Testcase:

    Code:
        public void onModuleLoad() {
            SC.showConsole();
            VLayout l = new VLayout();
            l.setWidth100();
            final ListGrid grid = new ListGrid();
            grid.setDataSource(new MyDS());
            
            grid.setWidth100();
            grid.setHeight(150);
            grid.setCanEdit(true);
            grid.setAutoFetchData(false);
            grid.setCanRemoveRecords(true);
            grid.setSaveLocally(true);
            grid.setAutoSaveEdits(false);
            grid.setEditEvent(ListGridEditEvent.CLICK);
    
            grid.setListEndEditAction(RowEndEditAction.NEXT);
            grid.setConfirmDiscardEdits(false);
            
    
    
            Button btn = new Button("New");
            btn.addClickHandler(new ClickHandler() {
    
                @Override
                public void onClick(ClickEvent event) {
                    HashMap<String,String> newValues = new HashMap<String,String>();
                    newValues.put("name","Some name");
                    grid.startEditingNew(newValues);
                }
            });
            
            l.addMember(grid);
            l.addMembers(btn);
            l.draw();
        }
    
        class MyDS extends DataSource {
            
            public MyDS() {
                super("MYDS");
                DataSourceIntegerField pkField = new DataSourceIntegerField("pk");  
                pkField.setHidden(true);  
                pkField.setPrimaryKey(true);  
                DataSourceField phone = new DataSourceField("phone", FieldType.LOCALEINT);
                DataSourceTextField name = new DataSourceTextField("name");
                setFields(pkField,name,phone);
                setClientOnly(true);
            }
        }
    Click new a couple of times to add a few records to the grid. Add integer values to the phone column. Then add something illegal as a phone number, i.e. a character 'a'. Try to change the value of 'a' back to a legal number.

    If I change the FieldType to Integer, everything works fine. However I need the formatting provided by the localeInt type unfortunately.


    Regards
    Rolf

    #2
    It's great that you included the date of the build, but what version are you using?

    Comment


      #3
      Sorry.

      I´m using 4.1p

      Regards
      Rolf

      Comment


        #4
        Also,

        It may be relevant that I´m located in Norway, so localeInt values are represented with space as a 1000 separator, i.e. 10 000 etc.

        Regards
        Rolf

        Comment


          #5
          Any news on this?

          Regards
          Rolf

          Comment

          Working...
          X