当我更改不同的标签时,我想更改layoutUnit内容动态。现在它可以在我单击其选项卡时更改测试集。当我回到原始标签。中心的所有内容都消失了。它无法再显示出来。有谁知道这个或如何解决这个问题?感谢。
<h:form id="mainForm">
<p:layoutUnit id="layoutunitleft" position="west" size="360"
resizable="true" collapsible="true" header="Options" minSize="260">
<p:accordionPanel id="accordingpanel1" rendered="true" >
<p:ajax event="tabChange" listener="#{mainNavBean.onChange}" update=":mainForm:projectform " />
<p:tab id="accordingpanel1tab" title="Project">
<p:commandLink id="projecttreelink" process="@this"
action="#{mainNavBean.setPage('project')}"
update=" :mainForm:projectform:scenarioDetailTable :mainForm:projectform:dynaFormGroup" >
<h:outputText value="Project" />
</p:commandLink>
</p:tab>
<p:tab title="Test Set">
<p:commandLink id="project" process="@this"
action="#{mainNavBean.setPage('testset')}" update=":mainForm:projectform" >
<h:outputText value="Test Set" />
</p:commandLink>
</p:tab>
<h:column/>
</p:accordionPanel>
</p:layoutUnit>
<!-- menu end -->
<p:growl id="growl" showDetail="true" />
<!-- scenario & step start -->
<p:layoutUnit id="layoutunitcenter" position="center" >
<p:layout>
<h:form id="projectform">
<ui:include src="#{mainNavBean.page}.xhtml" />
</h:form>
</p:layout>
</p:layoutUnit>
</p:layout>
</h:form>
public class MainNavBean mplements Serializable {
private static final long serialVersionUID = 1L;
private String page = "project";
public String getPage() {
return page;
}
public void setPage(String page) {
this.page = page;
}
}
project.xhtml是这样的:
<p:layoutUnit id="layoutsouth" position="south" size="410" resizable="true" >
<p:panel header="#{tableBean.tabTitle}" id="dynaFormGroup"
style="#{tableBean.selectedItemType eq -1? 'display:none':''}" >
....
</p:panel>
<p:layoutUnit id="layoutunitnorthcenter" position="center" resizable="true" layout="block">
<p:dataTable id="scenarioDetailTable" value="#{tableBean.scenariosModel}" var="scenariob"
selection="#{tableBean.selectedScenario}" selectionMode="single" rowkey="#{scenariob.id}"
rowStyleClass="#{scenariob.itemType ge 1 ? 'old' : null}" rendered="true" dynamic="true" >