I've created a GWT project and put all of the Test code in it. On a fetch (or any service call), I get the following error:
Code:
14:31:45.760 [ERROR] [gwtrpc] 14:31:45.758:WARN:RPCManager:Error performing rpcRequest: error: FAILURE, response: {clientContext: Obj, status: -1, context: undef, startRow: 0, endRow: 0, totalRows: 0} com.smartgwt.client.core.JsObject$SGWT_WARN: 14:31:45.758:WARN:RPCManager:Error performing rpcRequest: error: FAILURE, response: {clientContext: Obj, status: -1, context: undef, startRow: 0, endRow: 0, totalRows: 0} <snip stack trace>
Code:
public class YourEntryPoint implements EntryPoint { @Override public void onModuleLoad() { Canvas canvas = new Canvas(); TestDataSource dataSource = new TestDataSource(); final ListGrid yourGrid = new ListGrid(); yourGrid.setWidth(550); yourGrid.setHeight(200); yourGrid.setCellHeight(22); yourGrid.setDataSource(dataSource); ListGridField nameField = new ListGridField("name", "Name"); ListGridField locationField = new ListGridField("date", "DATE"); yourGrid.setFields(nameField, locationField); yourGrid.setAutoFetchData(true); // yourGrid.setDataFetchMode(FetchMode.BASIC); yourGrid.setDataFetchMode(FetchMode.PAGED); yourGrid.setShowAllRecords(false); yourGrid.setDataPageSize(20); yourGrid.setCanEdit(true); yourGrid.setShowFilterEditor(true); yourGrid.setEditEvent(ListGridEditEvent.DOUBLECLICK); IButton addRow = new IButton("Add new row"); addRow.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { ListGridRecord rec = new ListGridRecord(); rec.setAttribute("name", "yourName"); rec.setAttribute("date", new Date()); yourGrid.addData(rec); } }); addRow.setLeft(0); addRow.setTop(240); addRow.setWidth(140); IButton removeAll = new IButton("Remove All Selected"); removeAll.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { ListGridRecord[] selectedRecords = yourGrid.getSelection(); for(ListGridRecord rec: selectedRecords) { yourGrid.removeData(rec); } } }); removeAll.setLeft(320); removeAll.setTop(240); removeAll.setWidth(140); canvas.addChild(yourGrid); canvas.addChild(addRow); canvas.addChild(removeAll); canvas.draw(); // for debugging only, shows the developer console when hitting CTRL-D. if (!GWT.isScript()) { KeyIdentifier debugKey = new KeyIdentifier(); debugKey.setCtrlKey(true); debugKey.setKeyName("D"); Page.registerKey(debugKey, new KeyCallback() { public void execute(String keyName) { SC.showConsole(); } }); } } }
Anybody have a clue? I've also tested out the generic gwtrpcdatasource in marbot's thread and it works fine.
Leave a comment: