private void postOnInitRender(String idx) { //20080724, Henri Chen: optimize to avoid postOnInitRender twice if (getAttribute(ATTR_ON_INIT_RENDER) == null) { //Bug #2010389 setAttribute(ATTR_ON_INIT_RENDER, Boolean.TRUE); //flag syncModel Events.postEvent("onInitRender", this, idx); } }
public Comboitem newComboitem(Combobox combobox) { //clone from template final Comboitem clone = (Comboitem) _template.clone(); //TODO: see if databinder has this kind of Comboitem, if not, add new CollectionListItem //avoid duplicate id error, will set to new id when render() //Bug #1962153: Data binding generates duplicate id in some case add "_". if (clone.getId().length() > 0) { clone.setId(null); } //link cloned component with template //each Comboitem and and it descendants share the same templatemap Map<Object, Object> templatemap = new HashMap<Object, Object>(8); BindingRendererUtil.linkTemplates(clone, _template, templatemap, _binder); //link this template map to parent templatemap (Combobox in Combobox) Map parenttemplatemap = (Map) combobox.getAttribute(DataBinder.TEMPLATEMAP); if (parenttemplatemap != null) { templatemap.put(DataBinder.TEMPLATEMAP, parenttemplatemap); } //kept clone kids somewhere to avoid create too many components in browser final List<Component> kids = new ArrayList<Component>(clone.getChildren()); clone.setAttribute(KIDS, kids); clone.getChildren().clear(); return clone; } }
if (cbbox.getAttribute("org.zkoss.zul.Combobox.onInitRender") != null) {
Object oldVar = cb.getAttribute(varnm); Object oldIter = cb.getAttribute(itervarnm); cb.setAttribute(varnm, data); cb.setAttribute(itervarnm, iterStatus);
public void onChange(ListDataEvent event) { int type = event.getType(); if (getAttribute(Attributes.BEFORE_MODEL_ITEMS_RENDERED) != null && (type == ListDataEvent.INTERVAL_ADDED || type == ListDataEvent.INTERVAL_REMOVED)) return;