Hi, i am new in this forum..., i am developing an application using jsf, and richfaces. I need to add programatically, tabs (HtmlTab class) to a tab panel (HtmlTabPanel class), each tab must show a jsp page, so i use the include (Include class) to do that... but the new tab has no content...
This is my code:
JSP
<h:commandButton value="Add New Tab" action="#{informeManager.exploracionManager.crearNuevoFeto}"></h:commandButton> <h:commandButton value="Delete Tab" action="#{informeManager.exploracionManager.eliminarFeto}"></h:commandButton> <rich:tabPanel id="fetosTabPanel" switchType="client" binding="# {informeManager.exploracionManager.fetosTabPanel}" selectedTab="#{informeManager.exploracionManager.selectedTab}"> <rich:tab name="0" id="fetoTab0" label="Feto único"> <a4j:include viewId="eco_obstetrica_translucencia_details.jsp"></a4j:include> </rich:tab> </rich:tabPanel>
public void crearNuevoFeto(){ HtmlTab newTab = new HtmlTab(); newTab.setLabel(EcoObstetricaConstants.getOrdinalFetoFor(this.getFetosTabPanel().getChildCount())); newTab.setId("fetoTab" + (this.getFetosTabPanel().getChildCount())); newTab.setName(String.valueOf(this.getFetosTabPanel().getChildCount())); Include inc = new Include(); inc.setViewId("/pages/exploraciones/eco_obstetrica_translucencia_details.jsp"); newTab.getChildren().add(inc); this.getFetosTabPanel().getChildren().add(newTab); FacesContext.getCurrentInstance().renderResponse(); }