getWidget().filteringmode = getState().filteringMode;
+ getWidget().suggestionPopupWidth = getState().suggestionPopupWidth;
+
Profiler.leave("ComboBoxConnector.onStateChanged update content");
}
getWidget().currentPage = uidl.getIntVariable("page");
- if (uidl.hasAttribute("suggestionPopupWidth")) {
- getWidget().suggestionPopupWidth = uidl
- .getStringAttribute("suggestionPopupWidth");
- } else {
- getWidget().suggestionPopupWidth = null;
- }
-
getWidget().suggestionPopup.updateStyleNames(getState());
getWidget().allowNewItem = uidl.hasAttribute("allownewitem");
*/
private boolean scrollToSelectedItem = true;
- private String suggestionPopupWidth = null;
-
/**
* If text input is not allowed, the ComboBox behaves like a pretty
* NativeSelect - the user can not enter any text and clicking the text
String[] selectedKeys = new String[(getValue() == null
&& getNullSelectionItemId() == null ? 0 : 1)];
- if (suggestionPopupWidth != null) {
- target.addAttribute("suggestionPopupWidth",
- suggestionPopupWidth);
- }
-
// Paints the options and create array of selected id keys
int keyIndex = 0;
* @since 7.7
*/
public String getPopupWidth() {
- return suggestionPopupWidth;
+ return getState(false).suggestionPopupWidth;
}
/**
* the width
*/
public void setPopupWidth(String width) {
- suggestionPopupWidth = width;
- markAsDirty();
+ getState().suggestionPopupWidth = width;
}
/**
*/
public FilteringMode filteringMode = FilteringMode.STARTSWITH;
+ /**
+ * Suggestion pop-up's width as a CSS string. By using relative units (e.g.
+ * "50%") it's possible to set the popup's width relative to the ComboBox
+ * itself.
+ */
+ public String suggestionPopupWidth = null;
+
}