/** Sets whether to automatically complete this text box * by matching the nearest item ({@link Comboitem}. */ public void setAutocomplete(boolean autocomplete) { if (_autocomplete != autocomplete) { _autocomplete = autocomplete; smartUpdate("autocomplete", autocomplete); } }
/** Sets whether the button (on the right of the textbox) is visible. */ public void setButtonVisible(boolean visible) { if (_btnVisible != visible) { _btnVisible = visible; smartUpdate("buttonVisible", visible); } }
/** Sets whether to automatically drop the list if users is changing * this text box. */ public void setAutodrop(boolean autodrop) { if (_autodrop != autodrop) { _autodrop = autodrop; smartUpdate("autodrop", autodrop); } }
/** Sets empty search message. * This message would be displayed, when no matching results was found. * * @param msg * @since 8.5.1 */ public void setEmptySearchMessage(String msg) { if (_emptySearchMessage != msg) { _emptySearchMessage = msg; smartUpdate("emptySearchMessage", _emptySearchMessage); } }
/** * Sets the width of the popup of this component. * If the input is a percentage, the popup width will be calculated by multiplying the width of this component with the percentage. * (e.g. if the input string is 130%, and the width of this component is 300px, the popup width will be 390px = 300px * 130%) * Others will be set directly. * @param popupWidth the width of the popup of this component * @since 8.0.3 */ public void setPopupWidth(String popupWidth) { if (popupWidth != _popupWidth) { _popupWidth = popupWidth; smartUpdate("popupWidth", popupWidth); } }
public void onChildAdded(Component child) { super.onChildAdded(child); _syncItemIndicesLater = true; smartUpdate("repos", true); }
public void onChildRemoved(Component child) { super.onChildRemoved(child); _syncItemIndicesLater = true; if (child == _selItem) { // Bug B60-ZK-1202.zul _selItem = null; schedSyncValueToSelection(); } smartUpdate("repos", true); }
/** Deselects the currently selected items and selects the given item. * <p>Note: if the label of comboitem has the same more than one, the first * comboitem will be selected at client side, it is a limitation of {@link Combobox} * and it is different from {@link Listbox}.</p> * @since 3.0.2 */ public void setSelectedItem(Comboitem item) { if (item != null && item.getParent() != this) throw new UiException("Not a child: " + item); if (item != _selItem) { _selItem = item; if (item != null) { setValue(item.getLabel()); smartUpdate("selectedItemUuid_", item.getUuid()); } else { //Bug#2919037: don't call setRawValue(), or the error message will be cleared if (_value != null && !"".equals(_value)) { _value = ""; smartUpdate("value", coerceToString(_value)); } } _lastCkVal = getValue(); } }