Since I updated to SGWT 4.0d Power (2013-02-23), the following code does not work anymore:
Server side: manually sets data (HashMap) of the response
client side is supposed to receive in the response the data set by the server but response.getData() returns an empty array of record while in 3.1 it returned the expected record containing the HashMap.
Server side: manually sets data (HashMap) of the response
Code:
private DSResponse getDSResponse(Box box) throws Exception{ HashMap<String,String> data = new HashMap<String,String>(); data.put("url",box.getURL()); DSResponse resp = new DSResponse(); resp.setStatus(DSResponse.STATUS_SUCCESS); resp.setData(data); return resp; }
Code:
ds.performCustomOperation(oparationId,new Record(),new DSCallback(){ public void execute(DSResponse response,Object rawData, DSRequest request) { Record records[] = response.getData(); if (records.length>0){ String URL = records[0].getAttribute("url"); if (!(MoonDesktop.getProperty("chart.delete")).equals("false")){ URL += "?delete=true"; } htmlFlow.setContentsURL(URL); htmlFlow.show(); } } },request);
Comment