Reputation: 30058
I've a GWT app that I need to put FormPanel to wrap a textbox (TextBox). (to solve some styling issue)
EDIT:
The style issue is that: we are using some pre-build style sheet which put styles by HTML tag names .. so we need to put a form
tag to wrap some components in order to be able to read the styles!
the problem is, on the KeyPress event, I notice there is a loading in the page appears. although the result returns ajaxaly as if there's no client-server trip happened.
The question is, How to remove this trip to server?
NOTE: i am just wrapping the componenets into the formpanel, I've not set any properties of it:
FormPanel formPanel = new FormPanel();
CaptionPanel captionPanel = new CaptionPanel();
formPanel.add(captionPanel);
captionPanel.add(horizontalPanel);
verticalPanel.add(formPanel);
Thanks.
Upvotes: 0
Views: 1339
Reputation: 443
From your question, it isn't clear that what is causing the trip to the server. But if it is the FormPanel that's causing this, I would change the instantiation of the FormPanel to the following:
FormPanel formPanel = new FormPanel() {
public boolean onFormSubmit() { return false; }
};
This should be the equivalent of the following html, which will keep the form from submitting:
<form onsubmit="return false">
If this doesn't fix it, you'll need to do some more debugging to see where the server is being called. The Tamper Data plug-in for Firefox might be of help for this.
Upvotes: 1
Reputation: 80340
The whole point of FormPanel is to create a classis HTML-style form submission. It should be used to achieve interoperability with servers that require form submission.
Don't use FormPanel just to solve "some styling issues".
OTOH, if you need to retrieve some data from the server, AJAX-style, than read http://code.google.com/webtoolkit/doc/latest/tutorial/JSON.html#http
Upvotes: 1