public void onChildRemoved(Component child) { super.onChildRemoved(child); _syncItemIndicesLater = true; if (child == _selItem) { // Bug B60-ZK-1202.zul _selItem = null; schedSyncValueToSelection(); } smartUpdate("repos", true); }
@SuppressWarnings("rawtypes") public Object clone() { final Combobox clone = (Combobox) super.clone(); clone._selItem = null; clone.schedSyncValueToSelection(); if (clone._model != null) { if (clone._model instanceof ComponentCloneListener) { final ListModel model = (ListModel) ((ComponentCloneListener) clone._model).willClone(clone); if (model != null) clone._model = model; } clone._dataListener = null; clone._eventListener = null; clone.initDataListener(); } return clone; }
private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException { s.defaultReadObject(); schedSyncValueToSelection(); if (_model != null) { initDataListener(); // Map#Entry cannot be serialized, we have to restore them if (_model instanceof ListModelMap) { for (final Comboitem item : getItems()) { item.setValue(getElementAt(item.getIndex())); } } } }
public void setLabel(String label) { final String old = getLabel(); if (!Objects.equals(old, label)) { final Combobox cb = (Combobox) getParent(); final boolean syncValueToSelection = cb != null && cb.getSelectedItemDirectly() == this; super.setLabel(label); if (syncValueToSelection) { final Constraint constr = cb.getConstraint(); if (constr != null && constr instanceof SimpleConstraint && (((SimpleConstraint) constr).getFlags() & SimpleConstraint.STRICT) != 0) { cb.setValue(label); } else { cb.schedSyncValueToSelection(); } } } }