在我的代码中,当我将它放在第二个或第三个 PanelGroup 中时,CommandButton 操作不起作用。它仅在我放入第一个 PanelGroup 时才有效。我的代码如下所示。可能是什么问题?
<ui:define name="pageLocations">
<h:panelGroup layout="block" id="pageLocations">
<c:if test="#{param.typeTab == null && param.relationTab == null && param.propertyTab == null}">
<ui:param name="defaultHeaderTitle" value="Properties"/>
<!--<h:outputText value="Properties" />-->
</c:if>
<p class="breadcrumb">Admin <ezcomp:out value="raquo" />
Fields <ezcomp:out value="raquo" />
<strong>
#{param.pageHeaderTitle}#{defaultHeaderTitle}
</strong>
</p>
</h:panelGroup>
</ui:define>
<!--<ui:define></ui:define>-->
<ui:define name="pageHeaderTitle">
<h:outputText value="#{param.pageHeaderTitle}#{defaultHeaderTitle}" id="soso" />
</ui:define>
<ui:define name="sidemenu">
<ui:param name="fieldsPage" value="active"/>
</ui:define>
<ui:define name="admin-content">
<h:form prependId="false">
<h:panelGroup layout="block" class="well well-small" id="mainPanel">
<h:panelGroup layout="block" class="row-fluid">
<div class="span1"><ezcomp:out value="nbsp"/></div>
<div class="span4">
<ul class="nav nav-pills" style="margin-top:4px;margin-bottom:0">
<c:if test="#{param.typeTab == null && param.relationTab == null && param.propertyTab == null }">
<ui:param name="default" value="active"/>
<ui:param name="defaultHeaderTitle" value="Properties"/>
</c:if>
<li class="#{param.propertyTab} #{default}">
<p:commandLink value="Properties" immediate="true" update="mainPanel,fields,:soso,:pageLocations" >
<f:param name="propertyTab" value="active"/>
<f:param name="pageHeaderTitle" value="Properties"/>
</p:commandLink>
</li>
<li class="#{param.typeTab}">
<p:commandLink value="Types" immediate="true" async="true" update="mainPanel,fields,:soso,:pageLocations" >
<f:param name="typeTab" value="active"/>
<f:param name="pageHeaderTitle" value="Types"/>
</p:commandLink>
</li>
<li class="#{param.relationTab}">
<p:commandLink value="Fields Relations" immediate="true" update="mainPanel,fields,:soso,:pageLocations">
<f:param name="relationTab" value="active"/>
<f:param name="pageHeaderTitle" value="Fields Relations"/>
</p:commandLink>
</li>
</ul>
</div>
</h:panelGroup>
</h:panelGroup>
<h:panelGrid id="fields" width="100%">
<h:panelGroup layout="block" rendered="#{param.propertyTab == 'active' || default == 'active' }">
<ui:include src="property/properties.xhtml"></ui:include>
</h:panelGroup>
<h:panelGroup layout="block" rendered="#{param.typeTab == 'active'}">
<ui:include src="type/types.xhtml"></ui:include>
</h:panelGroup>
<h:panelGroup layout="block" rendered="#{param.relationTab == 'active'}">
<ui:include src="fields-relations.xhtml"></ui:include>
<h:commandButton value="Create" actionListener="#{fieldsRelationsController.createRelations()}" >
<f:ajax listener="#{fieldsRelationsController.createRelations()}"/>
</h:commandButton>
</h:panelGroup>
</h:panelGrid>
</h:form>
</ui:define>