Hi,
I tried sending an ArrayList to an RPC service in GWT but keeps on failing. Here is my code fragment
greetingService.addNewQuestion(questionnaireKey, questionText, qcList, new AsyncCallback<Boolean>(){
@Override
public void onFailure(Throwable caught) {
Window.alert("Something went wrong!\n"+caught.getMessage());
}
@Override
public void onSuccess(Boolean result) {
Window.alert("Question Added!");
}
});
QuestionChoice is a simple object with no method, and qcList is an ArrayList of QuestionChoice
public class QuestionChoice implements IsSerializable{
/**
*
*/
private static final long serialVersionUID = 5668640935838672293L;
public String text;
public boolean isCorrect;
public QuestionChoice(){
}
public QuestionChoice(String text, boolean isCorrect){
this.text = text;
this.isCorrect = isCorrect;
}
}
Has anyone tried sending an ArrayList as a parameter in GWT-RPC? If you do, please try to post your sample code here. Thank you.