RPC Design Question

1 view
Skip to first unread message

fk

unread,
Aug 28, 2006, 9:33:41 PM8/28/06
to Google Web Toolkit
I am working an auto complete textbox for an app. Auto complete textbox
will get data from an ejb. I have a business delegate class for finding
my rpc class and making calls.
I have created a Callback class with an extra method to return result.
Where I can cal my business delegate method to populated listbox to be
used by textbox for auto complete?
Also I can debug onSuccess method of my callback class. I have sample
code below.

Method of business delegate


public String[] getDataSource() {


System.out.println(" Getting Data Source ");
ws.getDataSource(callback);
String[] result = (String[])callback.getResult();

System.out.println(" Result ---->>>> " + result);

for(int i =0; i < result.length;i++) {
System.out.println("Data ---->>>> " + result[i]);
}
return result;

}

Callback Class

public class PersonCallback implements AsyncCallback {

private Object result;
/**
* @return the result
*/
public Object getResult() {
return result;
}

/**
* @param result the result to set
*/
public void setResult(Object result) {
this.result = result;
}

/* (non-Javadoc)
* @see
com.google.gwt.user.client.rpc.AsyncCallback#onFailure(java.lang.Throwable)
*/
public void onFailure(Throwable caught) {

System.out.println("onFailure " + caught.getMessage());
caught.printStackTrace();


}

/* (non-Javadoc)
* @see
com.google.gwt.user.client.rpc.AsyncCallback#onSuccess(java.lang.Object)
*/
public void onSuccess(Object result) {

System.out.println(" onSuccess " + result);
this.result = result;

}

}

Reply all
Reply to author
Forward
0 new messages