GWT FormPanel 并将数据提交到服务器
我有一个 GWT 应用程序,我需要将 FormPanel 放在文本框 (TextBox) 中。 (解决一些样式问题)
编辑: 样式问题是:我们正在使用一些预构建的样式表,它们通过 HTML 标记名称放置样式..因此我们需要放置一个 form
标记来包装一些组件以便能够读取风格!
问题是,在 KeyPress 事件中,我注意到页面中出现了加载。尽管结果返回ajaxaly,就好像没有发生客户端-服务器旅行一样。
问题是,如何去掉这行服务器呢?
注意:我只是将组件包装到表单面板中,我没有设置它的任何属性:
FormPanel formPanel = new FormPanel();
CaptionPanel captionPanel = new CaptionPanel();
formPanel.add(captionPanel);
captionPanel.add(horizontalPanel);
verticalPanel.add(formPanel);
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从您的问题来看,尚不清楚是什么原因导致服务器访问。但如果是 FormPanel 导致了此问题,我会将 FormPanel 的实例化更改为以下内容:
这应该相当于以下 html,这将使表单无法提交:
如果这不能解决问题,那么您'您需要进行更多调试才能查看服务器被调用的位置。适用于 Firefox 的 Tamper Data 插件可能会有所帮助为了这。
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:
This should be the equivalent of the following html, which will keep the form from submitting:
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.
FormPanel 的全部要点是创建一个 classis HTML 样式表单提交。它应该用于实现与需要表单提交的服务器的互操作性。
不要仅仅为了解决“一些样式问题”而使用 FormPanel。
OTOH,如果您需要从服务器检索一些 AJAX 风格的数据,请阅读 http://code.google.com/webtoolkit/doc/latest/tutorial/JSON.html#http
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