问题标签 [formpanel]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1200 浏览

gwt - 在窗体面板中添加滚动面板

我想在窗体面板中添加一个滚动面板,滚动面板将具有 com.extjs.gxt.ui.client.widget.form.AdapterField 的子类对象,它将使用隐藏和显示方法,如果代码片段可能会更好或给出示例代码...

0 投票
0 回答
446 浏览

gwt - GWT表单提交成功后如何渲染返回的HTML内容

我想在 GWT 中通过 模仿传统的表单提交FormPanel,但是页面无法在一次 HTTP 行程中重定向到动作 Servlet,也就是说,提交是一次行程,如果您window.location.assign进行另一次行程。即使我可以得到submitCompleteEvent.getResult无法正确呈现的结果 html。 这个问题对我没有帮助。

所以我拆分了这个问题:

1.我真的可以通过 GWT FormPanel 模仿 HTML 表单的行为,它会触发提交时的 go-to 操作页面吗?

2.如何利用表单成功提交返回的html?

0 投票
1 回答
117 浏览

java - 无法同时发送 ListBox 和文件

嗨,我正在使用 GWT 使用 servlet 发送文件。

最初我试图只向服务器发送文件。那工作得很好。

现在在 af ormPanel 中,我添加了 3 个列表框。

然后将其添加到 FormPanel。

在服务器端。

输出 :

根据我的动机是 listbox 的第一个值PropertyValue,其中列表框中的值更多。

并且应该显示更多的列表框。

我无法理解这正在发生。

注意:我无法通过 RPC 发送列表框,因为这些列表框与要发送到服务器和服务器到外部存储库的文件相关。

有人请帮忙。

0 投票
1 回答
649 浏览

java - 如何在 GWT 中获取服务器端的所有 ListBox 值

我正在使用 GWT

3 列表框被添加到容器(verticalPanel)中。容器被添加到 formPanel。

这些列表框有多个值。

在服务器端我有这个代码。

ServletFileUpload 上传 = 新的 ServletFileUpload();

但我只能得到列表框的第一个值

请告诉我如何获取列表框的所有值

注意:我不能通过 RPC 发送列表框,因为这些列表框与要发送到服务器和服务器到外部存储库的文件有关。

有人请帮忙。

0 投票
2 回答
9517 浏览

javascript - ExtJS 使用来自数据库 (JSON) 的数据填充 Ext.FormPanel

我正在使用 ExtJS (v3),并且我构建了一个要填充的表单,以便用户可以编辑数据然后将其提交回来。

表单已正确构建,并且数据正在从数据库中正确提取,但是我遇到困难的地方是使用数据库中的数据填充表单。

有人有建议吗?

这是我从数据库中提取的数据:

然后是我的表格:

0 投票
1 回答
1957 浏览

javascript - ExtJS v3 - 从表单面板内的网格面板访问数据

我有一个在表单中使用的 GridPanel。

当我提交表单时,我可以毫无问题地从表单元素中获取数据,但无法读取/查看放置在网格内的数据。

(基本上,我给他们一个区域来在网格中添加电子邮件地址)。

我在想我可以将网格面板数据设置为表单中的隐藏值,但这并没有像我想的那样工作。

我应该在这里采取什么方向,所以当有人提交表单时,我可以看到主要的“原因”字段(我现在可以看到)以及他们输入的每个电子邮件地址。

(我通过使用 POST 的按钮提交表单)。

0 投票
2 回答
1420 浏览

xml - GWT and Sencha GXT: FormPanel result fails

TL/DR: How to load an XML response via FormPanel reliably?


We have a web application in GWT using Sencha GXT for most of the UI. We use a GXT FormPanel to upload a file to a server-side script (which just echoes the file's contents) to get a local file's contents in JS. Eventually this can be done with FileReader, but obviously not in browsers that don't support that.

The FormPanel submits its form and loads the result in a hidden IFrame from which the contents are extracted with the following snippet (from FormPanelImpl.class):

We're loading an XML file that way and the problematic line is

because the XML is loaded as XML (and thus not embedded in a HTML wrapper) in a few cases. I tried the following:

  1. I used Content-Type: text/html originally (oversight in the local PHP test script, error on my part in the production code). Worked in Firefox and Chrome but not in IE (9) where the XML was loaded as XML in the IFrame instead.
  2. Content-Type: application/xml which would be the correct one for the payload. Now it doesn't work anywhere because we now get the behaviour that originally only IE exhibited in Chrome and FF too.
  3. Content-Type: application/octet-stream: Not a good idea, it just downloads the file.
  4. Content-Type: text/plain: I was hoping this would always trigger the HTML/body wrapping and it does, but it also wraps everything in a pre element so it now fails everywhere, but that at least reliably. Great.

After a little digging I found out that apparently the GXT FormPanel uses the same FormPanelImpl from GWT so results are identical for both anyway. And GWT's documentation says (which Sencha wisely withheld):

The back-end server is expected to respond with a content-type of 'text/html', meaning that the text returned will be treated as HTML. If any other content-type is specified by the server, then the result html sent in the onFormSubmit event will be unpredictable across browsers, and the FormHandler.onSubmitComplete(FormSubmitCompleteEvent) event may not fire at all.

However, even with sending text/html the behaviour is unpredictable across browsers if the payload is XML.

Is there a general solution to this? Or am I missing something terribly trivial (I'm looking at GWT for just three days now)?

EDIT: I tried prepending <html><body> to the file contents so even IE would have a body in the IFrame. Well, it did, but it also resulted in a very, very strange innerHTML starting with:

which the XML parser understandably chokes on.

0 投票
1 回答
5948 浏览

extjs - 将网格行中的数据加载到(弹出)表单中进行编辑

我在 Ext JS in Action(J. Garcia 著)中读到,如果我们有 Ext.data.Record 的实例,我们可以使用表单的 loadRecord 方法来设置表单的值。但是,他没有给出一个工作示例(在示例中,他使用数据通过名为 data.php 的文件加载到表单中)。我搜索了许多论坛,发现以下条目很有帮助,因为它让我了解了如何使用表单的 loadRecord 方法解决我的问题: 从网格加载数据到表单

现在我的商店和网格的代码如下:

'CreateUserForm' 是一个已经存在的表单的 ID,当用户点击编辑图标时它应该出现。然后应该使用网格行中的正确数据自动填充该弹出表单。

但是我的代码不起作用。我在“formpanel.getForm().loadRecord(rec)”行收到错误消息 - 它显示“Microsoft JScript 运行时错误:'undefined' is null or not an object”。

关于如何解决这个问题的任何提示?

0 投票
3 回答
13521 浏览

.net - 如何在全屏模式下以 Windows 形式拉伸内面板?

我有一个全屏运行的 Windows 应用程序,并且我的表单中有一些面板,我希望它们在宽度上伸展,我的意思是如何将宽度 = 100% 添加到这些面板?

如下图所示,右侧面板是我的内部面板(容器面板),应该可以拉伸,它包含许多项目:2 个面板、工具条和一个网格。我只是将 Doc="Fill" 和 Anchor="top; right; left; bottom" 设置为它,但没有任何改变。

在此处输入图像描述

0 投票
2 回答
3153 浏览

gwt - formpanel.submit 不在 GWT 服务器上提交文件

我想将文件从客户端发送到服务器。

我的代码:

客户端

getFlexTable_1()

getFileUpload()

}

在服务器端

现在,当我选择一个文件并单击添加按钮时,我无法在服务器端看到此代码的输出System.out.println("ServletWorking Fine");

System.out.println(GWT.getHostPageBaseURL() +"UploadFileServlet");客户端的输出是

当我直接在浏览器上使用这个 url 时,我得到了服务器端的输出System.out.println("ServletWorking Fine");**


已编辑

我又创建了一个用于文件上传的 Web 应用程序

服务器

此代码工作正常

在我看来,代码之间没有区别。

请告诉我为什么 formpanel.submit 不能正常工作。

请帮忙。