Dynamically adding tab content not update backing bean
aindrilaacharya Mar 30, 2013 6:36 AMBy using <a4j:repeat> I can successfully add dynamic tab.
Thank u for such a useful component.
On that dynamically added tab I create a <rich:panel> consist of some <h:inputtext>
By my problem is that whenever I am putting some values on that text boxes and submit the form, backing bean values are not updated.
Please tell me how could I get that values in backing bean
Thanks in advance
For ur ready reference I am attaching here with my code snippet:
//XHTML PAGE CODE
<ui:define name="content">
<h:form id="homeForm">
<h:panelGrid id="PanelGrid">
<ui:insert name="body">
<rich:tabPanel switchType="ajax" id="mainTabPanel" headerLocation="center">
<rich:tab header="#{menuCreator.bodyHead}" id="mainTabPanel1">
<ui:include src="" />
</rich:tab>
//DYNAMICALLY ADDED TAB CODE PORTION GOES HERE
<a4j:repeat value="#{beanClass.test}" var="skinName" >
<rich:tab header="#{skinName}" name="#{skinName}">
<ui:define name="body">
<a4j:region id="abc">
<a4j:commandLink
action="#{beanClass.save}"
id="save"
render="homeForm:categoryPanel"
title="Save" execute="homeForm:abc" />
<rich:panel header="INFORMATION" id="categoryPanel">
<h:outputLabel value="branchcode"/>
<h:inputText id="branchcode" value="#{beanClass.branchcode}"/>
<h:outputLabel value="branchname"/>
<h:inputText id="branchname" value="#{beanClass.branchname}" />
</rich:panel>
</a4j:region>
</ui:define>
</rich:tab>
</a4j:repeat>
</rich:tabPanel>
</ui:insert>
</h:panelGrid>
</h:form>
</ui:define>
//BEAN CLASS
BeanClass is as follows:
@SessionScope
public class beanClass implements Serializable {
@Column(name = "branchcode")
private String branchcode;
@Column(name = "branchname")
private String branchname;
public String getBranchcode() {
return branchcode;
}
public void setBranchcode(String branchcode) {
this.branchcode = branchcode;
}
public String branchname() {
return branchname;
}
public void setBranchname(String branchname) {
this.branchname = branchname;
}
}
I want to get the value of branchcode and branchname in bean class.