public void removeAttribute(Execution exec, String name) { exec.removeAttribute(name); } public Inline newInline(String txt){
/** Sets whether a component can directly generate HTML tags * to the output. * @see #isDirectContent */ public static boolean setDirectContent(Execution exec, boolean direct) { return (direct ? exec.setAttribute(ATTR_DIRECT_CONTENT, Boolean.TRUE) : exec.removeAttribute(ATTR_DIRECT_CONTENT)) != null; }
private static void restoreDynams(Execution exec, Map<String, Object> old) { if (old != null) for (Map.Entry<String, Object> me : old.entrySet()) { final String nm = me.getKey(); final Object val = me.getValue(); if (val != null) exec.setAttribute(nm, val); else exec.removeAttribute(nm); } }
public Object removeAttribute(String name, boolean recurse) { return exec().removeAttribute(name, recurse); }
public Object removeAttribute(String name) { return exec().removeAttribute(name); }
public void cleanup(Execution exec, Execution parent, List errs) { if (_enabled) { if (parent == null) { //root execution Map<Object, Object> map = getSessionMap(); if (map != null) { //20060912, henrichen: tricky. Remove the previously stuffed //something (when ExecutuionInit#init() is called) from //session map to make the map possible to be removed by the //ThreadLocalSessionContext#unbind() when it is empty. map.remove(SOMETHING); } exec.removeAttribute(HIBERNATE_SESSION_MAP); } } }
private Map<String, Object> setupDynams(Execution exec) { if (_dynams == null || _dynams.isEmpty()) return null; final Map<String, Object> old = new HashMap<String, Object>(); for (Map.Entry<String, Object> me : _dynams.entrySet()) { final String nm = me.getKey(); final Object val = me.getValue(); old.put(nm, exec.getAttribute(nm)); if (val != null) exec.setAttribute(nm, val); else exec.removeAttribute(nm); } return old; }
private void initModel() { Executions.getCurrent().removeAttribute("zkoss.Grid.deferInitModel_" + getUuid()); setModel(_model); }
private void initModel() { Executions.getCurrent().removeAttribute("zkoss.Listbox.deferInitModel_" + getUuid()); setModel(_model); //init the model }
} finally { exec.removeAttribute("javax.servlet.error.message"); exec.removeAttribute("javax.servlet.error.exception"); exec.removeAttribute("javax.servlet.error.exception_type"); exec.removeAttribute("javax.servlet.error.status_code"); exec.removeAttribute("javax.servlet.error.error_page");
public void doAfterCompose(Page page, Component[] comps) throws Exception { final Execution exec = Executions.getCurrent(); //resolve only once in the last page if (exec.getAttribute(RESOLVE_COMPOSITION) != this) { return; } exec.removeAttribute(RESOLVE_COMPOSITION); // resolve insert components final Map<String, Component> insertMap = new HashMap<String, Component>(); //(insert name, insert component) final Component parent = (Component) exec.getAttribute(PARENT); final Collection<Component> roots = (parent == null ? page.getRoots() : parent.getChildren()); resolveInsertComponents(roots, insertMap); //B65-ZK-2072: Resolves define components recursively. resolveDefineComponents(roots, insertMap); }
Executions.getCurrent().removeAttribute("zkoss.Listbox.deferInitModel_" + getUuid()); Executions.getCurrent().removeAttribute("zkoss.Listbox.deferInitModel_" + getUuid());
exec.removeAttribute(ATTR_TOP_NATIVE);
/** * @since 3.0.2 */ public Object coerceToBean(Object val, Component comp) { final Combobox cbbox = (Combobox) comp; if (Executions.getCurrent().getAttribute("zkoss.zkplus.databind.ON_SELECT" + cbbox.getUuid()) != null) { //bug #2140491 //triggered by coerceToUi(), ignore this Executions.getCurrent().removeAttribute("zkoss.zkplus.databind.ON_SELECT" + cbbox.getUuid()); return TypeConverter.IGNORE; } if (val != null) { final ListModel model = cbbox.getModel(); //Bug #2010389 //1. loadAll //2. setModel (by 1.), post onInitRender. //3. setSelectedItem (by 1.), coerceToUi, post onSelect with OLD Comboitem. //4. onInitRender(by 2.), syncModel and reconstruct new Comboitem(s) list, fire onInitRenderLater //** 5. save (by 3.), coreceToBean with OLD Comboitem, cannot locate the index with indexOf() //6. onInitRenderLater(by 4.), setSelectedItem, coerceToUi, post onSelect with new Comboitem //no model case, assume Comboitem.value to be used with selectedItem return model != null ? model.getElementAt(cbbox.getItems().indexOf(val)) : ((Comboitem) val).getValue(); } return null; }
Executions.getCurrent().removeAttribute("zkoss.Grid.deferInitModel_" + getUuid()); Executions.getCurrent().removeAttribute("zkoss.Grid.deferInitModel_" + getUuid());
public Object coerceToBean(Object val, Component comp) { //save final Listbox lbx = (Listbox) comp; if (Executions.getCurrent().getAttribute("zkoss.zkplus.databind.ON_SELECT" + lbx.getUuid()) != null) { //bug #2140491 //triggered by coerceToUi(), ignore this Executions.getCurrent().removeAttribute("zkoss.zkplus.databind.ON_SELECT" + lbx.getUuid()); return TypeConverter.IGNORE; } if (val != null) { final ListModel model = lbx.getModel(); //no model case, assume Listitem.value to be used with selectedItem return model != null ? model.getElementAt(((Listitem) val).getIndex()) : ((Listitem) val).getValue(); } return null; } }
I18Ns.cleanup(request, old); if (exec != null) { exec.removeAttribute(Attributes.PAGE_REDRAW_CONTROL); exec.removeAttribute(Attributes.PAGE_RENDERER);
exec.setAttribute(Attributes.PAGE_RENDERING, oldrendering); else exec.removeAttribute(Attributes.PAGE_RENDERING);