Hi all !

I'm having some problems with the communication client-server, i just
have to submit a form but I read it's better to use RPC so I've
deleted all the reference of FormPanel and trying to do it calling a
server, but it doesn't work :(

Am I supposed to pass all the fields of the form through the method of
the ServiceInterfaceAsync?
Up to now I'm trying to pass tha "name" field as a String parameter in
that method, but I always get back the "onFailure" result.

I think I configured everything properly but obviously I'm not sure
about it.
what url shoud I put here? ->  target.setServiceEntryPoint
(GWT.getModuleBaseURL() + "/provatesina/prenota");


This is the code I have in the main GWT class, it's inside the method
"onModuleLoad":


            final PrenotaServiceAsync prenotaService = (PrenotaServiceAsync)
GWT.create(PrenotaService.class);
            ServiceDefTarget target = (ServiceDefTarget) prenotaService;

            target.setServiceEntryPoint(GWT.getModuleBaseURL() + "/
provatesina/prenota");



            submit.addClickHandler(new ClickHandler() {
                    public void onClick(ClickEvent event) {

                        Window.alert("submitting the form");

                    prenotaService.prenota(nome.getText(), new
AsyncCallback <String>() {
                             public void onFailure(Throwable caught) {
                               Window.alert("RPC to prenota() failed.");
                             }
                             public void onSuccess(String result) {
                               lab.setText(result);
                             }

                    });
            };

        });

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.


Reply via email to