PDA

View Full Version : add success property or callback to my own function



pasblin
8 Sep 2009, 1:34 AM
how can i add a property or callback to my own function?? thx

Estefan
8 Sep 2009, 10:18 PM
create the callback object:

// the type of the object depends on the return type oh the method implemented on the server side
AsyncCallback<Boolean> callback= new AsyncCallback<Boolean>() {

public void onFailure(Throwable caught) {
//communication failed
MessageBox.alert("failure", "", null);
}

public void onSuccess(Boolean result) {
if (result == true) {
MessageBox.alert("Success", "", null);

}
}
};