带有 Smartgwt 的 GWT Suggestbox [英] GWT Suggestbox with Smartgwt
问题描述
我遇到了看不到 GWT Suggestbox 下拉列表的问题.我正在将 GWT Suggestbox 添加到 SmartGWT 的 VLayout.然后我可以看到Suggestbox的文本框.但是当我输入一些数据时,我看不到提供的建议.这是因为我使用的是 SmartGWT VLayout 吗?谁能告诉我如何解决它?谢谢.
I am facing a problem that I can't see the drop down list of the GWT Suggestbox. I am adding a GWT Suggestbox into SmartGWT's VLayout. Then I can see the textbox of the Suggestbox. But when I input some data, I can't see the suggestions provided. Is this because I am using the SmartGWT VLayout? Could anyone tell me how to solve it? Thanks.
抱歉,上面的问题还不够清楚.我的意思是我将一个 SuggestBox 添加到一个高度小的布局中.然后我可以看到 SuggestBox 的 TextBox 部分和部分建议,其余的建议似乎隐藏在其他布局下.下面是我的代码:
Sorry, the above question is not clear enough. What I mean is I add a SuggestBox into a layout with small height. Then I can see the the SuggestBox's TextBox part and part of the suggestion and the rest of the suggestion seems hide under other layout. Below is my code:
VLayout mainLayout = new VLayout();
mainLayout.setHeight100();
mainLayout.setWidth100();
MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();
oracle.add("a");
oracle.add("aa");
oracle.add("aaa");
oracle.add("aaaa");
oracle.add("aaaaa");
oracle.add("aaaaaa");
oracle.add("aaaaaaa");
SuggestBox box = new SuggestBox(oracle, new TextBox());
VLayout suggestBoxLayout = new VLayout();
suggestBoxLayout.setHeight("10%");
suggestBoxLayout.addMember(box);
VLayout body = new VLayout();
body.setBackgroundColor("#3B5998");
body.setHeight("90%");
mainLayout.addMember(body);
mainLayout.addMember(suggestBoxLayout);
所以当我在SuggestBox中输入a
时,我只能看到a,aa,aaa
,其余的建议被body
.
So when I enter a
into the SuggestBox, I can only see a, aa, aaa
and the rest suggestions are hide by the body
.
推荐答案
在 Alain 的帮助下,我将 .gwt-SuggestBoxPopup {z-index: 1000000;}
添加到我的 CSS 中.然后我解决了这个问题.
With the help from Alain, I add .gwt-SuggestBoxPopup {z-index: 1000000;}
into my CSS. Then I solve the problem.
这篇关于带有 Smartgwt 的 GWT Suggestbox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!