import com.vaadin.shared.EventId;
import com.vaadin.shared.communication.FieldRpc.FocusAndBlurServerRpc;
import com.vaadin.shared.ui.Connect;
-import com.vaadin.shared.ui.combobox.ComboBoxConstants;
import com.vaadin.shared.ui.combobox.ComboBoxServerRpc;
import com.vaadin.shared.ui.combobox.ComboBoxState;
-import com.vaadin.shared.ui.combobox.FilteringMode;
import com.vaadin.ui.ComboBox;
@Connect(ComboBox.class)
getWidget().pageLength = getState().pageLength;
+ getWidget().filteringmode = getState().filteringMode;
+
Profiler.leave("ComboBoxConnector.onStateChanged update content");
}
// not a FocusWidget -> needs own tabindex handling
getWidget().tb.setTabIndex(getState().tabIndex);
- if (uidl.hasAttribute("filteringmode")) {
- getWidget().filteringmode = FilteringMode.valueOf(uidl
- .getStringAttribute("filteringmode"));
- }
-
getWidget().nullSelectionAllowed = uidl.hasAttribute("nullselect");
getWidget().nullSelectItem = uidl.hasAttribute("nullselectitem")
getWidget().currentPage = uidl.getIntVariable("page");
- if (uidl.hasAttribute("pagelength")) {
- getWidget().pageLength = uidl.getIntAttribute("pagelength");
- }
-
if (uidl.hasAttribute("suggestionPopupWidth")) {
getWidget().suggestionPopupWidth = uidl
.getStringAttribute("suggestionPopupWidth");
// Current page when the user is 'paging' trough options
private int currentPage = -1;
- private FilteringMode filteringMode = FilteringMode.STARTSWITH;
-
private String filterstring;
private String prevfilterstring;
private boolean isFilteringNeeded() {
return filterstring != null && filterstring.length() > 0
- && filteringMode != FilteringMode.OFF;
+ && getFilteringMode() != FilteringMode.OFF;
}
@Override
suggestionPopupWidth);
}
- target.addAttribute("filteringmode", getFilteringMode().toString());
-
// Paints the options and create array of selected id keys
int keyIndex = 0;
Filterable filterable = (Filterable) container;
- Filter filter = buildFilter(filterstring, filteringMode);
+ Filter filter = buildFilter(filterstring, getFilteringMode());
// adding and removing filters leads to extraneous item set
// change events from the underlying container, but the ComboBox does
} else {
caption = caption.toLowerCase(getLocale());
}
- switch (filteringMode) {
+ switch (getFilteringMode()) {
case CONTAINS:
if (caption.indexOf(filterstring) > -1) {
filteredOptions.add(itemId);
@Override
public void setFilteringMode(FilteringMode filteringMode) {
- this.filteringMode = filteringMode;
+ getState().filteringMode = filteringMode;
}
@Override
public FilteringMode getFilteringMode() {
- return filteringMode;
+ return getState(false).filteringMode;
}
@Override
*
* @see #getPopupWidth()
* @since 7.7
- * @param width the width
+ * @param width
+ * the width
*/
public void setPopupWidth(String width) {
suggestionPopupWidth = width;