Hello,
event.getRecord() throws a nasty JS error when you have editValues in a grid (because of a validation error).
Repro:
click the Add new record button
Fill in 50 in column0
Go out of edit mode
Click the row
SmartGWT 3
Dev mode, FF 4.0.1
SmartClient Version: SC_SNAPSHOT-2011-08-25/Pro Deployment
event.getRecord() throws a nasty JS error when you have editValues in a grid (because of a validation error).
Repro:
click the Add new record button
Fill in 50 in column0
Go out of edit mode
Click the row
Code:
private class MyType extends SimpleType { public MyType() { super("mine", FieldType.ANY); IntegerRangeValidator v = new IntegerRangeValidator(); v.setMin(1); v.setMax(10); setValidators(v); } } private void test16() { Canvas c = new Canvas(); c.setBorder("20px solid black"); c.setWidth(500); c.setHeight(200); new MyType().register(); final ListGrid grid = new ListGrid(); grid.addCellClickHandler(new CellClickHandler() { public void onCellClick(CellClickEvent event) { GWT.log("SilkListGrid on cell click"); ListGridRecord r = event.getRecord(); } }); grid.setWidth(200); grid.setHeight(200); String fieldName1 = "a"; String fieldName2 = "b"; ListGridField field1 = new ListGridField(fieldName1); field1.setAttribute("type", "mine"); ListGridField field2 = new ListGridField(fieldName2); grid.setFields(field1, field2); Button addData = new Button("Add new record"); addData.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { Record newRecordDefaults = new Record(); grid.startEditingNew(newRecordDefaults); } }); VLayout layout = new VLayout(); layout.setWidth100(); layout.setHeight(600); layout.setMembers(c, addData, grid); masterPanel.addChild(layout); }
Code:
Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError): elem is null fileName: http://localhost:8880 lineNumber: 56 stack: (null,"__ref")@http://localhost:8880:56 (null,5767386,null)@http://localhost:8880/smarteetester/hosted.html?smarteetester:56 ()@http://localhost:8880:19 ([object GWTJavaObject],1179847,[object GWTJavaObject])@http://localhost:8880/smarteetester/hosted.html?smarteetester:56 (null,0,1)@http://localhost:8880:1876 ((function () {var param = {record: arguments[0], rowNum: arguments[1], colNum: arguments[2]};var event = __gwt_makeJavaInvoke(1)(null, 10944643, param);__gwt_makeJavaInvoke(1)(selfJ, 1179847, event);var ret = __gwt_makeJavaInvoke(0)(event, 1572870);return !ret;}),[object Object],[object Arguments])@http://localhost:8880:77 (null,94,(function () {var param = {record: arguments[0], rowNum: arguments[1], colNum: arguments[2]};var event = __gwt_makeJavaInvoke(1)(null, 10944643, param);__gwt_makeJavaInvoke(1)(selfJ, 1179847, event);var ret = __gwt_makeJavaInvoke(0)(event, 1572870);return !ret;}),[object Object],[object Arguments])@http://localhost:8880/smarteetester/hosted.html?smarteetester:56 (null,0,1)@http://localhost:8880:16 (null,0,1)@http://localhost:8880:13 anonymous(null,0,1)@http://localhost:8880/smarteetester/sc/modules/ISC_Grids.js:1007 isc_GridRenderer__cellClick(null,0,1)@http://localhost:8880/smarteetester/sc/modules/ISC_Grids.js:811 isc_GridRenderer__rowClick(0,1)@http://localhost:8880/smarteetester/sc/modules/ISC_Grids.js:808 isc_GridRenderer_click([object Object],(void 0))@http://localhost:8880/smarteetester/sc/modules/ISC_Grids.js:805 isc_Canvas_handleClick([object Object],(void 0))@http://localhost:8880/smarteetester/sc/modules/ISC_Core.js:3206 isc_c_EventHandler_bubbleEvent([object Object],"click")@http://localhost:8880/smarteetester/sc/modules/ISC_Core.js:1646 isc_c_EventHandler_handleClick([object Object])@http://localhost:8880/smarteetester/sc/modules/ISC_Core.js:1488 isc_c_EventHandler__handleMouseUp([object MouseEvent],(void 0))@http://localhost:8880/smarteetester/sc/modules/ISC_Core.js:1475 isc_c_EventHandler_handleMouseUp([object MouseEvent])@http://localhost:8880/smarteetester/sc/modules/ISC_Core.js:1466 isc_c_EventHandler_dispatch(isc_c_EventHandler_handleMouseUp,[object MouseEvent])@http://localhost:8880/smarteetester/sc/modules/ISC_Core.js:1710 anonymous([object MouseEvent])@http://localhost:8880/smarteetester/sc/modules/ISC_Core.js:60 at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:129) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at com.smartgwt.client.widgets.grid.events.GridRowColEvent.getRecord(GridRowColEvent.java) at com.example.myproject.client.SmartEETester$23.onCellClick(SmartEETester.java:1089)
Dev mode, FF 4.0.1
SmartClient Version: SC_SNAPSHOT-2011-08-25/Pro Deployment
Comment