protected void encodeCurrentStep(FacesContext facesContext, Wizard wizard) throws IOException { for (UIComponent child : wizard.getChildren()) { if (child instanceof Tab && child.isRendered()) { Tab tab = (Tab) child; if ((wizard.getStep() == null || tab.getId().equals(wizard.getStep()))) { tab.encodeAll(facesContext); break; } } } }
@Override public void encodeEnd(FacesContext context, UIComponent component) throws IOException { Map<String, String> params = context.getExternalContext().getRequestParameterMap(); TabView tabView = (TabView) component; String clientId = tabView.getClientId(context); String var = tabView.getVar(); if (tabView.isContentLoadRequest(context)) { Tab tabToLoad = null; if (var == null) { String tabClientId = params.get(clientId + "_newTab"); tabToLoad = tabView.findTab(tabClientId); tabToLoad.encodeAll(context); tabToLoad.setLoaded(true); } else { int tabindex = Integer.parseInt(params.get(clientId + "_tabindex")); tabView.setIndex(tabindex); tabToLoad = (Tab) tabView.getChildren().get(0); tabToLoad.encodeAll(context); tabView.setIndex(-1); } } else { tabView.resetLoadedTabsState(); encodeMarkup(context, tabView); encodeScript(context, tabView); } }
protected void encodeTabContent(FacesContext context, Tab tab, int index, boolean active, boolean dynamic) throws IOException { ResponseWriter writer = context.getResponseWriter(); String styleClass = active ? TabView.ACTIVE_TAB_CONTENT_CLASS : TabView.INACTIVE_TAB_CONTENT_CLASS; writer.startElement("div", null); writer.writeAttribute("id", tab.getClientId(context), null); writer.writeAttribute("class", styleClass, null); writer.writeAttribute("role", "tabpanel", null); writer.writeAttribute(HTML.ARIA_HIDDEN, String.valueOf(!active), null); writer.writeAttribute("data-index", index, null); if (dynamic) { if (active) { tab.encodeAll(context); tab.setLoaded(true); } } else { tab.encodeAll(context); } writer.endElement("div"); }
@Override public void encodeEnd(FacesContext context, UIComponent component) throws IOException { Map<String, String> params = context.getExternalContext().getRequestParameterMap(); AccordionPanel acco = (AccordionPanel) component; if (acco.isContentLoadRequest(context)) { String var = acco.getVar(); String clientId = acco.getClientId(context); if (var == null) { String tabClientId = params.get(clientId + "_newTab"); Tab tabToLoad = acco.findTab(tabClientId); tabToLoad.encodeAll(context); tabToLoad.setLoaded(true); } else { int index = Integer.parseInt(params.get(clientId + "_tabindex")); acco.setIndex(index); acco.getChildren().get(0).encodeAll(context); acco.setIndex(-1); } } else { acco.resetLoadedTabsState(); encodeMarkup(context, acco); encodeScript(context, acco); } }
protected void encodeCurrentStep(FacesContext facesContext, Wizard wizard) throws IOException { for (UIComponent child : wizard.getChildren()) { if (child instanceof Tab && child.isRendered()) { Tab tab = (Tab) child; if ((wizard.getStep() == null || tab.getId().equals(wizard.getStep()))) { tab.encodeAll(facesContext); break; } } } }
@Override public void encodeEnd(FacesContext context, UIComponent component) throws IOException { Map<String, String> params = context.getExternalContext().getRequestParameterMap(); TabView tabView = (TabView) component; String clientId = tabView.getClientId(context); String var = tabView.getVar(); if (tabView.isContentLoadRequest(context)) { Tab tabToLoad = null; if (var == null) { String tabClientId = params.get(clientId + "_newTab"); tabToLoad = tabView.findTab(tabClientId); tabToLoad.encodeAll(context); tabToLoad.setLoaded(true); } else { int tabindex = Integer.parseInt(params.get(clientId + "_tabindex")); tabView.setIndex(tabindex); tabToLoad = (Tab) tabView.getChildren().get(0); tabToLoad.encodeAll(context); tabView.setIndex(-1); } } else { tabView.resetLoadedTabsState(); encodeMarkup(context, tabView); encodeScript(context, tabView); } }
@Override protected void encodeTabContent(FacesContext context, Tab tab, int index, boolean active, boolean dynamic) throws IOException { ResponseWriter writer = context.getResponseWriter(); String visibility = active ? "display:block" : "display:none"; writer.startElement("div", null); writer.writeAttribute("id", tab.getClientId(context), null); writer.writeAttribute("style", visibility, null); writer.writeAttribute("role", "tabpanel", null); writer.writeAttribute("aria-hidden", String.valueOf(!active), null); if (dynamic) { if (active) { tab.encodeAll(context); tab.setLoaded(true); } } else { tab.encodeAll(context); } writer.endElement("div"); } }
protected void encodeTabContent(FacesContext context, Tab tab, int index, boolean active, boolean dynamic) throws IOException { ResponseWriter writer = context.getResponseWriter(); String styleClass = active ? TabView.ACTIVE_TAB_CONTENT_CLASS : TabView.INACTIVE_TAB_CONTENT_CLASS; writer.startElement("div", null); writer.writeAttribute("id", tab.getClientId(context), null); writer.writeAttribute("class", styleClass, null); writer.writeAttribute("role", "tabpanel", null); writer.writeAttribute("aria-hidden", String.valueOf(!active), null); writer.writeAttribute("data-index", index, null); if (dynamic) { if (active) { tab.encodeAll(context); tab.setLoaded(true); } } else { tab.encodeAll(context); } writer.endElement("div"); }
@Override public void encodeEnd(FacesContext context, UIComponent component) throws IOException { Map<String, String> params = context.getExternalContext().getRequestParameterMap(); AccordionPanel acco = (AccordionPanel) component; if (acco.isContentLoadRequest(context)) { String var = acco.getVar(); String clientId = acco.getClientId(context); if (var == null) { String tabClientId = params.get(clientId + "_newTab"); Tab tabToLoad = acco.findTab(tabClientId); tabToLoad.encodeAll(context); tabToLoad.setLoaded(true); } else { int index = Integer.parseInt(params.get(clientId + "_tabindex")); acco.setIndex(index); acco.getChildren().get(0).encodeAll(context); acco.setIndex(-1); } } else { acco.resetLoadedTabsState(); encodeMarkup(context, acco); encodeScript(context, acco); } }