public void execute(Event<UISearchBasisPortlet> event) throws Exception { UISearchBasisPortlet uiSearchBasisPortlet = event.getSource(); String id = event.getRequestContext().getRequestParameter(OBJECTID); if (id == null) return; for (UIComponent uicomponent : uiSearchBasisPortlet.getChildren()) { if (!uicomponent.getId().equals(id)) { uicomponent.setRendered(false); } else { uicomponent.setRendered(true); } } event.getRequestContext().addUIComponentToUpdateByAjax(uiSearchBasisPortlet); }
@Override public void execute(Event<UITabContainer> event) throws Exception { UITabContainer container = event.getSource(); PortalRequestContext pcontext = (PortalRequestContext) event.getRequestContext(); if (container == null) { return; } List<UIComponent> children = container.getChildren(); for (UIComponent child : children) { if (child.isRendered() && child instanceof UIContainer) { UIContainer newTabContainer = container.addChild(UIContainer.class, null, null); newTabContainer.setTemplate(child.getTemplate()); child.setRendered(false); newTabContainer.setRendered(true); newTabContainer.setId(String.valueOf(newTabContainer.hashCode())); pcontext.addUIComponentToUpdateByAjax(container); pcontext .getJavascriptManager() .require("SHARED/portal", "portal") .addScripts("portal.PortalComposer.toggleSaveButton();"); return; } } }
public void execute(Event<UITabContainer> event) throws Exception { String objectId = event.getRequestContext().getRequestParameter(OBJECTID); UITabContainer container = event.getSource(); UIComponent goal = container.findComponentById(objectId); if (goal == null) { return; } UITabContainer parent = goal.getParent(); List<UIComponent> children = parent.getChildren(); for (UIComponent child : children) { if (child.getId().equals(objectId)) { child.setRendered(true); continue; } child.setRendered(false); } }