0
我正在動態頁面上工作。想用tabmenu包含一個xhtml頁面到主要的xhtml頁面。當我運行代碼總是同一頁面包含主頁面。標籤不工作anoymore。tabmenu項目不改變和HTML頁面不包括正確
主html。
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<f:view contentType="text/html">
<h:head>
<f:facet name="first">
<meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
<title>İstatistik</title>
</f:facet>
</h:head>
<body>
<p:layout fullPage="true">
<p:layoutUnit position="north" style="font-size: 12px!important" >
<p:tabMenu id="tabmenu1" activeIndex="#{turnPage.index}" >
<p:menuitem value="Genel" outcome="main" actionListener="#{turnPage.actionEventPage(e, 0)}" update="mainpanel" />
<p:menuitem value="Demografik Göstergeler" outcome="main" actionListener="#{turnPage.actionEventPage(e, 1)}" update="mainpanel" />
<p:menuitem value="Mortalite ve Mobidite" outcome="main" actionListener="#{turnPage.actionEventPage(e, 2)}" update="mainpanel" />
<p:menuitem value="Risk Faktörleri" outcome="main" actionListener="#{turnPage.actionEventPage(e, 3)}" update="mainpanel" />
<p:menuitem value="Bağışıklama Anne/çocuk" outcome="main" actionListener="#{turnPage.actionEventPage(e, 4)}" update="mainpanel" />
<p:menuitem value="Sağlık Kurumları" outcome="main" actionListener="#{turnPage.actionEventPage(e, 5)}" update="mainpanel" />
</p:tabMenu>
</p:layoutUnit>
<p:layoutUnit position="center">
<p:outputPanel id="mainpanel" >
<h:form>
<ui:include src="#{turnPage.pathpage}"/>
</h:form>
</p:outputPanel>
</p:layoutUnit>
</p:layout>
</body>
}
,這裏是我的豆。
{
private int index;
private String pathpage;
public void setPathpage(String pathpage) {
this.pathpage = pathpage;
}
public String getPathpage() {
return pathpage;
}
public void setIndex(int index) {
this.index = index;
}
public int getIndex() {
return index;
}
public void actionEventPage(ActionEvent e, int index){
switch (index) {
case 0:
pathpage = "forms/genel.xhtml";
break;
case 1:
pathpage = "forms/demografi.xhtml";
break;
case 2:
pathpage = "forms/mortalite.xhtml";
break;
case 3:
pathpage = "forms/riskfaktor.xhtml";
break;
case 4:
pathpage = "forms/bagisiklama.xhtml";
break;
case 5:
pathpage = "forms/saglikkurum.xhtml";
break;
它不是複製。實際上,我可以包括第一頁,但tabmenu項目索引不會改變,當我選擇任何選項卡,並選擇頁面不包括。 –
如果您按照副本中的開球示例,它會。 – BalusC