My client side code is as follows where I am sending some data to the server to just print out the output. But when it returns from the server I get a empty listgrid record. what is the cause for this.
Here is the screen shot of the issue
if (fieldName.equals("Approve"))
{
IButton button = new IButton();
button.setHeight(18);
button.setWidth(65);
button.setTitle("Approve");
button.addClickHandler(new ClickHandler()
{
public void onClick(ClickEvent event)
{
DebugTools.print("SOID " + record.getAttribute("supplierOrderID") + " SODID" + record.getAttribute("sodID")+" sordID "+record.getAttribute("sordID"));
approveProduct(record.getAttribute("supplierOrderID"), record.getAttribute("sodID"),record.getAttribute("sordID"));
}
private void approveProduct(String supplierOrderID, String sodID, String sordID)
{
Record record = new Record();
record.setAttribute("supplierOrderID", supplierOrderID);
record.setAttribute("sodID", sodID);
record.setAttribute("sordID",sordID);
historyGrid.addData(record, callback);
}
DSCallback callback = new DSCallback()
{
@Override
public void execute(DSResponse response, Object rawData, DSRequest request)
{
Record[] records = response.getData();
if (records != null && records.length > 0)
{
Record record = records[0];
JavaScriptObject js = record.getJsObj(); JSONObject json = new JSONObject(js); System.out.println(" records.length " + records.length); for (int i = 0; i < records.length; i++) { Record recordd = records[i];
JavaScriptObject jss = recordd.getJsObj();
JSONObject jsonn = new JSONObject(jss);
System.out.println(jsonn.toString());
}
}
}
};
and on the server side my add method is very simple for now where I am just printing the data I received from the client
public DSResponse add(DSRequest dsRequest) throws Exception
{
DSResponse dsResponse = new DSResponse();
Long user_idlong = SessionUtills.getSessionUser(dsRequest.getHttpServletRequest());
System.out.println("sodID " + dsRequest.getFieldValue("sodID").toString());
System.out.println("PRODUCT APPROVED !!!!!!!!!!!!!" + " SUPPLIER ORDER ID " + dsRequest.getFieldValue("supplierOrderID").toString());
return dsResponse;
}
I have also attached the shot of the issue