GWT 组合框无法正确显示

发布于 2024-10-11 19:32:14 字数 1729 浏览 4 评论 0原文

我正在使用 GWT 和在 glassfish 中运行的 GWT-EXT。我创建了 2 个组合框,如下所示:


import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.SimpleComboBox;

this.contentPanel = new ContentPanel();
this.contentPanel.setFrame(true);
this.contentPanel.setSize((int)(Window.getClientWidth()*0.95), 600);
this.contentPanel.setLayout(new FitLayout());
initWidget(this.contentPanel);

SimpleComboBox<String> combo = new SimpleComboBox<String>();
combo.setEmptyText("Select a topic...");
combo.add("String1");
combo.add("String2");
this.contentPanel.add(combo);

ComboBox combo1 = new ComboBox();
combo1.setEmptyText("Select a topic...");
ListStore topics = new ListStore();
topics.add("String3");
topics.add("String4");
combo.setStore(topics);
this.contentPanel.add(combo1);

当这些组合框加载到浏览器(IE 8.0、Firefox 3.6.6 或 Chrome 10.0)中时,会显示组合框,但没有下拉箭头。它们看起来像一个带有“选择主题...”文本的文本字段。当您选择文本时,它会消失,如果您键入一个字符然后将其删除,则会显示选项(即调用下拉菜单),但是仍然没有下拉箭头。

有谁知道问题可能是什么?或者我如何进一步调查?是否可以看到浏览器获取的实际 HTML,当我查看页面源代码时,我只获取登陆页面 HTML。

另外,我还有一个导入 com.google.gwt.user.client.ui.Grid 无法正确呈现。它采用表格格式,但没有网格线或标题栏等。

干杯,

James

这是有问题的 HTML DIV:

<div class=" x-form-field-wrap  x-component" id="x-auto-5" style="width: 150px;">
    <input type="text" class=" x-form-field x-form-text  x-form-empty-field" id="x-auto-5-input" tabindex="0" autocomplete="off" style="width: 126px;">
    <img class="x-form-trigger x-form-trigger-arrow" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" id="x-auto-6">
</div>

我相信指定的图像是空白图像。为什么它不使用箭头图像,它肯定是默认的 GWT/浏览器图像?

I am using GWT with GWT-EXT running in glassfish. I create 2 combo boxes as follows:


import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.SimpleComboBox;

this.contentPanel = new ContentPanel();
this.contentPanel.setFrame(true);
this.contentPanel.setSize((int)(Window.getClientWidth()*0.95), 600);
this.contentPanel.setLayout(new FitLayout());
initWidget(this.contentPanel);

SimpleComboBox<String> combo = new SimpleComboBox<String>();
combo.setEmptyText("Select a topic...");
combo.add("String1");
combo.add("String2");
this.contentPanel.add(combo);

ComboBox combo1 = new ComboBox();
combo1.setEmptyText("Select a topic...");
ListStore topics = new ListStore();
topics.add("String3");
topics.add("String4");
combo.setStore(topics);
this.contentPanel.add(combo1);

When these are loaded in the browser (IE 8.0, Firefox 3.6.6 or Chrome 10.0) the combo boxes are shown but don't have the pull down arrow. They look like a text field with the "Select a topic..." text. When you select the text it disappears and if you type a character and then delete it the options are shown (i.e. pull down is invoked) however, there is still no pull down arrow.

Does anyone know what the issue might be? Or how I can investigate further? Is it possible to see the actual HTML the browser is getting, when I View Page Source I only get the landing page HTML.

As an additional I also have a import com.google.gwt.user.client.ui.Grid that does not render correctly. It is in table format but has no grid lines or header bar etc.

Cheers,

James

This is the HTML DIV with the issue:

<div class=" x-form-field-wrap  x-component" id="x-auto-5" style="width: 150px;">
    <input type="text" class=" x-form-field x-form-text  x-form-empty-field" id="x-auto-5-input" tabindex="0" autocomplete="off" style="width: 126px;">
    <img class="x-form-trigger x-form-trigger-arrow" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" id="x-auto-6">
</div>

I believe the image specified is the blank image. Why is it not using the arrow image surely it is a default GWT/browser image?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

笑梦风尘 2024-10-18 19:32:14

FireBug 将是您与 FireFox 最好的朋友。你可以检查所有内容,css文件,html或javascript。我确实有类似的问题,我的问题与丢失的图像文件有关。我确实通过firebug找到了它..

FireBug would be your best friend with FireFox. You can inspect everything, css files, html or javascript.. I do have a similar problem , my problem was related to a missing image file. I did find it by means of firebug..

错々过的事 2024-10-18 19:32:14

如果您将 GWT 与 GWT-EXT 一起使用,那么为什么要使用 EXT-JS 的组合框,请使用 GWT-EXT 的组合框。

If you are using GWT with GWT-EXT than why are you using combobox of EXT-JS use combobox of GWT-EXT.

躲猫猫 2024-10-18 19:32:14

我的 Landing html 页面中缺少以下内容。好吧,我有参考,但它指向错误的相对位置。

<link rel="stylesheet" type="text/css" href="extgwt/css/gxt-all.css" />

I was missing the following from my Landing html page. Well I had the reference but it was pointing to the wrong relative location.

<link rel="stylesheet" type="text/css" href="extgwt/css/gxt-all.css" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文