drenda81
7 Jul 2008, 1:07 PM
Hi all,
I've a question about rpc call. In a class where I've a Form Panel I can make a rpc call in standard mode?
For example when the sumbit button is pressed I make a rpc call. Despite when I compile all works fine, when I run the application and click on submit button is raised a javascript exception (Incompatible type).
A portion of cose look like this:
save.addSelectionListener(new SelectionListener<ComponentEvent>() {
@Override
public void componentSelected(ComponentEvent arg0) {
long id = 0;
if (utente != null) {
id = utente.getId();
}
if (panel.isValid()) {
try {
utente = Utente.build(id, (String) username.getValue(), (String) password.getValue(), (String) cognome.getValue(), (String) nome.getValue(), (String) email.getValue(), (String) telefono.getValue(), tipologiaBox.getSelectedIndex() + 1);
/***************************************************************************/
/*CHIAMATA RPC */
/***************************************************************************/
save.setEnabled(false);
Application.get().getService().inserisciUtente(utente, new AsyncCallback() {
public void onFailure(Throwable arg0) {
try {
throw arg0;
} catch (DbException e) {
save.setEnabled(true);
Info.display("Attenzione", " " + e.getMessage(), "");
} catch (Throwable e) {
//Window.alert("Problemi di comunicazione col server");
}
}
public void onSuccess(Object arg0) {
utente.setId((Long) arg0);
save.setEnabled(true);
InfoConfig ic = new InfoConfig("Info", "Utente salvato correttamente");
ic.display = 5000;
Info.display(ic);
}
});
The use of rpc calls in ext gwt is cofused for me yet :-?
Thanks
I've a question about rpc call. In a class where I've a Form Panel I can make a rpc call in standard mode?
For example when the sumbit button is pressed I make a rpc call. Despite when I compile all works fine, when I run the application and click on submit button is raised a javascript exception (Incompatible type).
A portion of cose look like this:
save.addSelectionListener(new SelectionListener<ComponentEvent>() {
@Override
public void componentSelected(ComponentEvent arg0) {
long id = 0;
if (utente != null) {
id = utente.getId();
}
if (panel.isValid()) {
try {
utente = Utente.build(id, (String) username.getValue(), (String) password.getValue(), (String) cognome.getValue(), (String) nome.getValue(), (String) email.getValue(), (String) telefono.getValue(), tipologiaBox.getSelectedIndex() + 1);
/***************************************************************************/
/*CHIAMATA RPC */
/***************************************************************************/
save.setEnabled(false);
Application.get().getService().inserisciUtente(utente, new AsyncCallback() {
public void onFailure(Throwable arg0) {
try {
throw arg0;
} catch (DbException e) {
save.setEnabled(true);
Info.display("Attenzione", " " + e.getMessage(), "");
} catch (Throwable e) {
//Window.alert("Problemi di comunicazione col server");
}
}
public void onSuccess(Object arg0) {
utente.setId((Long) arg0);
save.setEnabled(true);
InfoConfig ic = new InfoConfig("Info", "Utente salvato correttamente");
ic.display = 5000;
Info.display(ic);
}
});
The use of rpc calls in ext gwt is cofused for me yet :-?
Thanks