0

我正在尝试以其他形式呈现不同的<h:form>使用。<a4j:jsFunction>但是它不起作用。我实现的代码如下:

<t:div style="display:table-row; ">
    <a4j:region>
        <t:div style="display:table-cell; border:1px solid #608AA9;">
            <h:form id="accordForm">
                <rich:accordion id="accordId" switchType="client" activeItem="#{projectCreation.activeTab}">
                    <c:forEach var="proj" items="#{projectCreation.projects}">
                        <rich:accordionItem name="#{proj.description}">
                        <f:facet name="header">#{proj.description}</f:facet>
                            <h:form id="moduleAccord" rendered="#{proj.childCount>0}">
                                <rich:accordion id="moduleAccordId" switchType="client" activeItem="#{projectCreation.activeModuleTab}" onitemchange="moduleAccordionChange();">
                                    <a4j:jsFunction name="moduleAccordionChange" execute="@all" render="@all" action="#{projectCreation.accordionItemChange}" />
                                    <c:forEach var="mdle" items="#{proj.modules}">
                                        <rich:accordionItem id="module#{mdle.id}" name="#{mdle.description}">
                                            <f:facet name="header">#{mdle.description}</f:facet>
                                            <h:form id="formodule#{mdle.id}" rendered="#{mdle.childCount>0}">
                                                <t:dataList id="subModuleList" var="subMdle" value="#{mdle.subModules}" layout="unorderedList">
                                                    <a4j:commandButton id="subModuleCmd" value="#{subMdle.description}" action="#{projectCreation.fetchSubModuleDetails}">
                                                        <f:param name="subModuleId" value="#{subMdle.id}" />
                                                    </a4j:commandButton>
                                                </t:dataList>
                                            </h:form>
                                        </rich:accordionItem>
                                    </c:forEach>
                                </rich:accordion>
                            </h:form>
                        </rich:accordionItem>
                    </c:forEach>
                </rich:accordion>
            </h:form>
        </t:div>
    </a4j:region>
    <h:form id="rightContent">
        <t:div id="rightContentDiv">
        <h:outputText id="selectedPage" value="#{projectCreation.creationModel.selectedPage}" />
            <t:div id="projectDiv" style="display:table-cell;" rendered="#{projectCreation.creationModel.selectedPage=='Project'}">
                <a4j:outputPanel ajaxRendered="true">
                    <ui:include src="/WEB-INF/facelets/project/editProject.xhtml"/>
                </a4j:outputPanel>
            </t:div>
            <t:div id="moduleDiv" style="display:table-cell;" rendered="#{projectCreation.creationModel.selectedPage=='Module'}">
                <a4j:outputPanel ajaxRendered="true">
                    <ui:include src="/WEB-INF/facelets/project/addModule.xhtml"/>
                </a4j:outputPanel>
            </t:div>
        </t:div>
    </h:form>
</t:div>

我正在尝试在选择嵌套手风琴模块时更改呈现的页面。我在日志中检查了它在控制器中工作正常,但在 facelet 上没有按预期工作。它在我使用时工作,switchType="server"但是它会完全重新加载页面,我只想renderrightContent form.

4

1 回答 1

0

看看这个展示示例:

不要嵌套表单,HTML 不支持这个!

于 2013-01-31T13:50:06.890 回答