ah, alright then. Please find below the corresponding code. Thank you
for your consideration:
public class Hello implements EntryPoint {
public void onModuleLoad() {
final Button b = new Button("Click me");
// Create a handler for the sendButton and nameField
class MyHandler implements ClickHandler, KeyUpHandler {
/**
* Fired when the user clicks on the sendButton.
*/
public void onClick(ClickEvent event) {
RequestBuilder builder = new
RequestBuilder(RequestBuilder.GET,
"http://192.168.1.107:7001/NTM_REST/ChartCorr/getFeature");
try {
Request response = builder.sendRequest(null, new
RequestCallback() {
public void onError(Request request, Throwable
exception) {
Window.alert("onError: " + exception);
}
public void onResponseReceived(Request request,
Response
response) {
Window.alert("onResponseReceived,
response.getStatusCode
(): " + response.getStatusCode() +
" , response.getText(): " +
response.getText());
}
});
} catch (RequestException e) {
Window.alert("RequestException: " +
e.toString());
}
}
/**
* Fired when the user types in the nameField.
*/
public void onKeyUp(KeyUpEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
;
}
}
}
// Add a handler to send the name to the server
MyHandler handler = new MyHandler();
b.addClickHandler(handler);
RootPanel.get().add(b);
}
}
On Sep 18, 1:46 pm, Ian Bambury <[email protected]> wrote:
> There is something wrong with your code.
> Without the code, it isn't easy to say what that might be.
>
> Ian
>
> http://examples.roughian.com
>
> 2009/9/18 thc <[email protected]>
>
>
>
>
>
> > Hi, I have an app invoking a remote web service via
> > RequestBuilder.sendRequest(). The problem I am having is that the
> > remote service is only invoked the first time the client app is loaded
> > into the browser. However, the call ALWAYS returns STATUS_CODE 200,
> > regardless if remote service is invoked or not.
>
> > Any ideas on how to avoid a reload of client app into browser (in
> > order for the remote call to work) would be greatly appreciated.
> > Thanks
>
> > I am running in web mode, as opposed to hosted mode, if that helps at
> > all.. Thanks.- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---