As per the doc, the intended behaviour of ListGrid.setStopOnErrors(true) is not allowing the user to select another row before the save of the current modified row is successfully saved.
However, it is not always working.
Steps to reproduce:
1. Take any ListGrid with multiple rows having setStopOnErrors(true) set.
2. Modify a row so that the server response an error.
3. Click an other row - notice, that the clicked row is not selected and the error message is displayed - it is fine so far.
4. Click the other row again - notice that the other row is selected, and actually the request to the server is not sent at all.
Comment: if you set the focus to an other cell in the edited row between steps 3 and 4, then it works as expected.
SmartClient Version: v11.1p_2017-08-08/LGPL Development Only (built 2017-08-08)
Browser: Chrome 60.0.3112.113
Minimal test case:
dummyData.jsp:
However, it is not always working.
Steps to reproduce:
1. Take any ListGrid with multiple rows having setStopOnErrors(true) set.
2. Modify a row so that the server response an error.
3. Click an other row - notice, that the clicked row is not selected and the error message is displayed - it is fine so far.
4. Click the other row again - notice that the other row is selected, and actually the request to the server is not sent at all.
Comment: if you set the focus to an other cell in the edited row between steps 3 and 4, then it works as expected.
SmartClient Version: v11.1p_2017-08-08/LGPL Development Only (built 2017-08-08)
Browser: Chrome 60.0.3112.113
Minimal test case:
Code:
public void onModuleLoad() { Canvas canvas = new Canvas(); final ListGrid grid = new ListGrid(); grid.setWidth(600); grid.setHeight(224); grid.setShowAllRecords(true); grid.setStopOnErrors(true); RestDataSource ds = new RestDataSource(); ds.setDataURL("http://127.0.0.1:8888/dummyData.jsp"); grid.setDataSource(ds); ListGridField nameField = new ListGridField("countryName", "CountryName"); ListGridField populationField = new ListGridField("population", "Population"); grid.setFields(nameField, populationField); grid.setAutoFetchData(true); grid.setCanEdit(true); canvas.addChild(grid); canvas.draw(); }
Code:
<% if ("fetch".equals(request.getParameter("_operationType"))) { %> <response> <status>0</status> <startRow>0</startRow> <endRow>2</endRow> <totalRows>2</totalRows> <data> <record><countryName>Uganda</countryName><population>1000</population></record> <record><countryName>Etiopia</countryName><population>2000</population></record> </data> </response> <% } else { %> <response> <status>-1</status> <data>ERROR</data> </response> <% } %>
Comment