GWT Suggestbox with Smartgwt

被刻印的时光 ゝ 提交于 2019-11-28 05:42:24

问题


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.


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);        

So when I enter a into the SuggestBox, I can only see a, aa, aaa and the rest suggestions are hide by the body.


回答1:


This may be zIndex related, but there's no reason to use GWT's SuggestBox and run into problems like this. Use SmartGWT's ComboBoxItem. If you don't want a drop-down control to appear at the end of the text entry area, call setShowPickerIcon(false).




回答2:


With the help from Alain, I add .gwt-SuggestBoxPopup {z-index: 1000000;} into my CSS. Then I solve the problem.




回答3:


It would be easier with little bit of code. Before stopping to mix Smartgwt with Gwt I integrated some code which was using GWt suggestBox and it was working.... (Why don't you use the Smartgwt selectitem it does the job?) Regards

Alain



来源:https://stackoverflow.com/questions/8713770/gwt-suggestbox-with-smartgwt

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!