public Object removeAttribute(String name) { return _owner.removeAttribute(name); }
public static void unmarkHandling(Component comp) { comp.removeAttribute(BinderImpl.BINDER); }
public Object removeAttribute(String name, boolean recurse) { return _owner.removeAttribute(name, recurse); }
private void removeForm(Component comp) { String id = (String) comp.getAttribute(FORM_ID, Component.COMPONENT_SCOPE); if (id != null) { comp.removeAttribute(FORM_ID); Object form = comp.removeAttribute(id); if (form != null) initSaveFormMap().remove(form); comp.removeAttribute(id + "Status"); } }
public void loadComponentForAllBinders() { _host.removeAttribute(KEY_BINDER_KEEPER); for (Loader loader : _queue) { loader.load(); } }
public static Object removeModel(Component comp) { final String name = getModelName(comp); return comp.removeAttribute(name); }
/** Retrieves the data associated with an echo event. * Notice that the data will be removed, so the next call always returns null. * @since 5.0.4 */ public static Object getData(Component comp, Object key) { final Object[] inf = (Object[]) comp.getAttribute(Attributes.ECHO_DATA); if (inf != null) { final Map map = (Map) inf[1]; final Object data = map.remove(key); if (map.isEmpty()) comp.removeAttribute(Attributes.ECHO_DATA); return data; } return null; }
protected void recordRenderedIndex(Component owner, int itemSize) { // clean up first for first time to invoke if (!isFirstTime) { isFirstTime = true; owner.removeAttribute(RENDERED_COMPONENTS); } Map<String, Integer> indexes = (Map<String, Integer>) owner.getAttribute(RENDERED_COMPONENTS); if (indexes == null) { indexes = new LinkedHashMap<String, Integer>(); owner.setAttribute(RENDERED_COMPONENTS, indexes); } int index = indexes.isEmpty() ? 0 : new LinkedList<Integer>(indexes.values()).getLast().intValue() + 1; for (int size = indexes.size(), start = 0; start < itemSize; start++) { indexes.put(String.valueOf(size + start), index); } }
public void onEvent(Event event) throws Exception { //suicide first... _host.removeEventListener("onRootBinderHostDone", this); BinderKeeper keeper = (BinderKeeper) _host.getAttribute(KEY_BINDER_KEEPER); if (keeper == null) { // suppose to be null... } else { // The App is in trouble. // some error might happened during page processing // which cause loadComponent() never invoked. _host.removeAttribute(KEY_BINDER_KEEPER); } } });
public void onEvent(Event event) throws Exception { final Component comp = event.getTarget(); //remove mark to prevent zkbind1(B36-1968616) cause it not removed in detach handling listener comp.removeAttribute(REMOVE_MARK); comp.removeEventListener(ON_ZKBIND_LATER, this); handleComponentAttached(comp); } });
private void removeBindings0(Component comp, Map<Binder, Set<Component>> batchRemove) { //A component with renderer; might need to remove $MODEL$ final Object installed = comp.removeAttribute(BinderImpl.RENDERER_INSTALLED); if (installed != null) { BindELContext.removeModel(comp); } final Binder binder = BinderUtil.getBinder(comp, comp.hasAttribute(BinderCtrl.IS_TEMPLATE_MODEL_ENABLED_ATTR)); if (binder != null) { if (batchRemove != null) { //ZK-2224 batch remove component and it kids to enhance performance. Set<Component> components = batchRemove.get(binder); if (components == null) { batchRemove.put(binder, components = new LinkedHashSet<Component>()); } components.add(comp); } else { binder.removeBindings(comp); } } getExtension().removeLifeCycleHandling(comp); }
/** Applies the custom attributes. * <p>Note: this method does nothing if {@link #isEffective} returns false. */ public void apply(Component comp) { if (_attrs != null && isEffective(comp)) { final Evaluator eval = getEvaluator(); for (Map.Entry<String, Object> me : _attrs.entrySet()) { final String name = me.getKey(); final Object value = me.getValue(); comp.setAttribute(name, Utils.evaluateComposite(eval, comp, value), _scope != -1 ? _scope : Component.COMPONENT_SCOPE); //bug zk-1298, handle special composerName, see Components#wireController if ("composerName".equals(name)) { Object ctrlnm = comp.getAttribute(name); if (ctrlnm instanceof String) { Object controller = comp.removeAttribute("_$composer$_"); //get from special attribute if (controller != null && comp.getAttribute((String) ctrlnm) == null) { comp.setAttribute((String) ctrlnm, controller); } } } } } }
@SuppressWarnings("unchecked") private void syncModel(ListModel<?> model) { //clear all List<Component[]> cbrCompsList = (List<Component[]>) _owner .getAttribute(BinderCtrl.CHILDREN_BINDING_RENDERED_COMPONENTS); if (cbrCompsList != null) { _owner.removeAttribute(BinderCtrl.CHILDREN_BINDING_RENDERED_COMPONENTS); for (Component[] oldComps : cbrCompsList) { if (oldComps != null) { for (Component oc : oldComps) { oc.detach(); } } } } renderModelData(model, 0, model.getSize() - 1); }
if (comp.removeAttribute(BinderCtrl.CHILDREN_BINDING_RENDERED_COMPONENTS) != null) { ListModel<?> model = (ListModel<?>) comp.getAttribute(BinderCtrl.CHILDREN_BINDING_MODEL); ListDataListener listener = (ListDataListener) comp .removeAttribute(BinderCtrl.CHILDREN_BINDING_MODEL_LISTENER); if (model != null && listener != null) { model.removeListDataListener(listener);
eachComp.setAttribute(EACH_VAR, oldEach); } else { eachComp.removeAttribute(EACH_VAR); eachComp.removeAttribute(EACH_STATUS_VAR);
public void onEvent(Event event) throws Exception { final Component comp = event.getTarget(); comp.removeAttribute(REMOVE_MARK); comp.removeEventListener(BinderImpl.ON_BIND_CLEAN, this); // Bug ZK-3045, we need to handle the detached component // to remove all its references in a tracker. if (comp.hasAttribute(BinderImpl.VAR)) { Object ref = comp.getAttribute((String) comp.getAttribute(BinderImpl.VAR)); if (ref instanceof ReferenceBinding) { BinderUtil.markHandling(comp, ((ReferenceBinding) ref).getBinder()); } } removeBindings(comp); } });
Events.postEvent(new Event(ON_ZKBIND_LATER, comp)); return; } else if (!Boolean.FALSE.equals(comp.removeAttribute(SKIP_BIND_INIT))) {
kid.removeAttribute(BinderCtrl.REMOVE_BINDINGS); final Binder nestedBinder = (Binder) kid .getAttribute((String) kid.getAttribute(BindComposer.BINDER_ID));
@SuppressWarnings("unchecked") public void onEvent(T event) { //fetch old Event stored in Session and post again final Component comp = event.getTarget(); final Page page = comp.getPage(); final String url = (String) event.getData(); final Execution exec = Executions.getCurrent(); try { doModal(page, url); } finally { if (comp.isListenerAvailable(event.getName(), true)) { EventListener listener = (EventListener) comp.getAttribute(event.getName()); if (listener != null) { comp.removeEventListener(event.getName(), listener); comp.removeAttribute(event.getName()); } } } }
protected void redrawChildren(Writer out) throws IOException { Tree tree = getTree(); if (!tree.inPagingMold()) { super.redrawChildren(out); } else if (isRealVisible() && shallVisitTree(tree, this)) { if (shallRenderTree(tree)) { ComponentCtrl child = getTreerow(); if (child != null) child.redraw(out); } boolean close = !isOpen(); ComponentCtrl child = getTreechildren(); if (child != null) { if (close) ((Component) child).setAttribute(Attributes.SHALL_RENDER_ITEM, Boolean.TRUE); child.redraw(out); if (close) ((Component) child).removeAttribute(Attributes.SHALL_RENDER_ITEM); } } }