Search code examples
cssgwtsuggestbox

A border issue of suggestboxPopup in GWT


I am using a SuggestBox in GWT.I also inherit the Standard theme from SuggestionBox.gwt.xml as

  <inherits name='com.google.gwt.user.theme.standard.Standard'/>

so this are using default standard css for widget Suggestbox and it is making border through image as hborder.png,vborder.png etc..I want to remove this but my css is not working.

.gwt-SuggestBoxPopup{
  border  :    1px solid #000000;
}

so how can i solve this issue.Please help me. Thanks Rahul


Solution

  • The class used for the popup is a DefaultSuggestionDisplay for default SuggestBox. It uses a DecoratedPopupPanel as you can see in SuggestBox.java around line 392.

    To avoid "heavy" border, you have to create/override a SuggestionDisplay that uses a non-decorated popupPanel and pass it to your SuggestBox trough constructor

       public SuggestBox(SuggestOracle oracle, TextBoxBase box,SuggestionDisplay suggestDisplay); 
    

    Say, "border" is not sufficient, because DecoratedPopupPanel uses multiple cells to set borders, as you seen in the CSS. So you probably can update CSS directly but it will apply to all project, as SuggestBox does not seems to handle resource bundle directly.