Hi
I want to call handleError method when an error occurs in server.
To achieve this I write a method in a static class as suggested by Isomotphic.
public static void handelError()
{
RPCManager.setHandleErrorCallback(new HandleErrorCallback() {
@Override
public void handleError(DSResponse response, DSRequest request) {
System.out.println("Responce received.handleError..");
}
});
}
To do it centralize I call this method within onModuleLoad function.
@Override
public void onModuleLoad() {
callJavaScript();
//ClientUtility.readConfiProperty();
readConfiProperty();
ComponentUtility.handelError();
History.addValueChangeHandler(this);
History.fireCurrentHistoryState();
}
Following steps I have execute in order to confirm that my code is executed correctly when an error occurs in server.
1. I call a valuesManager.fetch method from a page in side application.
valuesManager is binded with a datasource.
2. From server side I return DSResponse.
So I set status value to -1 which indicates that this request fails.
DSResponse response = new DSResponse();
response.setStatus(-1);
return response;
Problem is when I return from server, handleError method not executes.
But I think handleError method should call in this time.
Can anyone help me.?
Am I missing something ?
Is my way of implementation is incorrect ?
I am using
SmartClient Version: v8.3_2012-11-20/PowerEdition Deployment (built 2012-11-20)
mozilla-25
chrome-Version 40.0.2214.111 m
IE-9
I want to call handleError method when an error occurs in server.
To achieve this I write a method in a static class as suggested by Isomotphic.
public static void handelError()
{
RPCManager.setHandleErrorCallback(new HandleErrorCallback() {
@Override
public void handleError(DSResponse response, DSRequest request) {
System.out.println("Responce received.handleError..");
}
});
}
To do it centralize I call this method within onModuleLoad function.
@Override
public void onModuleLoad() {
callJavaScript();
//ClientUtility.readConfiProperty();
readConfiProperty();
ComponentUtility.handelError();
History.addValueChangeHandler(this);
History.fireCurrentHistoryState();
}
Following steps I have execute in order to confirm that my code is executed correctly when an error occurs in server.
1. I call a valuesManager.fetch method from a page in side application.
valuesManager is binded with a datasource.
2. From server side I return DSResponse.
So I set status value to -1 which indicates that this request fails.
DSResponse response = new DSResponse();
response.setStatus(-1);
return response;
Problem is when I return from server, handleError method not executes.
But I think handleError method should call in this time.
Can anyone help me.?
Am I missing something ?
Is my way of implementation is incorrect ?
I am using
SmartClient Version: v8.3_2012-11-20/PowerEdition Deployment (built 2012-11-20)
mozilla-25
chrome-Version 40.0.2214.111 m
IE-9