/** * Clears the selection. */ public void clearSelection() { if (!_selItems.isEmpty()) { for (Listitem item : _selItems) { item.setSelectedDirectly(false); } _selItems.clear(); _jsel = -1; if (inSelectMold()) smartUpdate("selectedIndex", -1); else smartUpdate("selectedItem", null); // Bug 1734950: don't count on index (since it may change) } }
protected void smartUpdate(String name, Object value) { //make it accessible in this package Listbox box = getListbox(); if (isVisible() || box == null || !box.inSelectMold()) super.smartUpdate(name, value); }
protected void smartUpdate(String name, boolean value) { //make it accessible in this package Listbox box = getListbox(); if (isVisible() || box == null || !box.inSelectMold()) super.smartUpdate(name, value); }
protected void smartUpdate(String name, int value) { Listbox box = getListbox(); if (isVisible() || box == null || !box.inSelectMold()) super.smartUpdate(name, value); }
/** Returns the maximal length for this cell. * If listbox's mold is "select", it is the same as * {@link Listbox#getMaxlength} * If not, it is the same as the correponding {@link #getListheader}'s * {@link Listheader#getMaxlength}. * * <p>Note: {@link Listitem#getMaxlength} is the same as {@link Listbox#getMaxlength}. */ public int getMaxlength() { final Listbox listbox = getListbox(); if (listbox == null) return 0; if (listbox.inSelectMold()) return listbox.getMaxlength(); final Listheader lc = getListheader(); return lc != null ? lc.getMaxlength() : 0; }
/** Sets the value. * @param value the value. * <p>Note: the value is application dependent, you can place * whatever value you want. * <p>If you are using listitem with HTML Form (and with * the name attribute), it is better to specify a String-typed * value. */ public <T> void setValue(T value) { if (!Objects.equals(_value, value)) { _value = value; final Listbox listbox = getListbox(); if (listbox != null) if (listbox.inSelectMold()) smartUpdate("value", _value); else if (listbox.getName() != null) smartUpdate("value", _value); } }
if (_frozen != null && _frozen != newChild) throw new UiException("Only one frozen child is allowed: " + this); if (inSelectMold()) log.warn("Mold select ignores frozen"); } else if (newChild instanceof Listfoot) { if (_listfoot != null && _listfoot != newChild) throw new UiException("Only one listfoot is allowed: " + this); if (inSelectMold()) log.warn("Mold select ignores listfoot"); } else if (newChild instanceof Paging) {
public boolean setVisible(boolean visible) { if (isVisible() == visible) return visible; final boolean result = super.setVisible(visible); final Listbox listbox = (Listbox) getParent(); if (listbox != null) { if (listbox.inSelectMold()) listbox.invalidate(); final Listgroup g = listbox.getListgroupAt(getIndex()); if (g == null || g.isOpen()) listbox.addVisibleItemCount(visible ? 1 : -1); } // Bug ZK-485, send after invoking listbox.addVisibleItemCount() smartUpdate("visible", visible); return result; }
if (inSelectMold()) { smartUpdate("selectedIndex", _jsel); } else if (item != null)
if (inSelectMold()) { smartUpdate("selectedIndex", _jsel); } else if (item != null)
ofs = _pgi.getActivePage() * pgsz; } else { pgsz = inSelectMold() ? getItemCount() : getDataLoader().getLimit(); ofs = inSelectMold() ? 0 : getDataLoader().getOffset();
if (!inSelectMold()) { smartUpdate("model", model instanceof GroupsListModel || model instanceof GroupsModel ? "group" : true); _model = null; getItems().clear(); if (!inSelectMold()) smartUpdate("model", false); getDataLoader().updateModelInfo();
if (inSelectMold()) { render(renderer, "multiple", isMultiple()); render(renderer, "disabled", isDisabled());