Tuesday 29 January 2013

GWT SuggestBox Enable and Disable

import com.google.gwt.user.client.DOM;

//pass in your own TextBox when you construct the SB:
TextBox tb = new TextBox();
SuggestBox sb = new SuggestBox(oracle, tb);

// and disable the TextBox it can effect to SuggestBox
tb.setEnabled(false);

// and enable the TextBox it can effect to SuggestBox
tb.setEnabled(true);


public static void setEnabled(SuggestBox sb,boolean enabled)
{
DOM.setElementPropertyBoolean(sb.getElement(), "disabled", !enabled);
}

 
 
 

No comments:

Post a Comment