Announcement

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

    Bug with listgrid setStopOnErrors property

    Running SmartClient Version: v10.0p_2015-08-31
    SmartGWT 5.0

    On Chrome 44.0.2403.157

    Preparation steps:
    1. Create a ListGrid with single cell editing.
    3. Set to true ListGrid properties of setWaitForSave and setStopOnErrors;

    Steps to represent the bug:
    1. Click on any cell to edit it.
    2. Click on any other cell to cancel editing.
    3. Click on the third cell to edit it.

    Bug behaviour:
    After clicking on the third cell, u'll go editing the cell, that u've clicked before, to exit the editor mode, but not to the cell, that u've clicked right now.

    Code to represent the bug: .

    public class StopOnErrorsListGrid extends ListGrid{

    public StopOnErrorsListGrid() {
    List<ListGridField> fields = new ArrayList<>();
    for (int i = 0; i < 10; i++) {
    ListGridField field = new ListGridField("field" + i, "field" + i, 100);
    fields.add(field);
    }

    setWaitForSave(true);
    setStopOnErrors(true);
    setCanEdit(true);
    setEditByCell(true);
    setEditEvent(ListGridEditEvent.CLICK);
    setCanSelectCells(true);
    setFields(fields.toArray(new ListGridField[fields.size()]));

    List<ListGridRecord> records = new ArrayList<>();
    {
    for (int j = 0; j < 20; j++) {
    ListGridRecord rec = new ListGridRecord();
    for (int i = 0; i < 10; i++) {
    rec.setAttribute("field" + i, i);
    }
    records.add(rec);
    }
    }
    setData(records.toArray(new ListGridRecord[records.size()]));
    }
    }
    Attached Files

    #2
    The grid would work correctly, if you remove setStopOnErrors property

    Comment

    Working...
    X