猿问

如何在JSF页面中使用<h:form>?单一表格?多种形式?嵌套表单?

我正在使用Faclet模板技术在我正在开发的JSF 2应用程序中布局我的页面。

在我的head er.xhtml中,PrimeFaces要求把menubar用h:form括起来。

<h:form>
    <p:menubar autoSubmenuDisplay="true">
        Menu Items here!    </p:menubar></h:form>

因此,在我的内容页面中,我将有另一个h:Form或更多。

如果我把h:form放在我的template.xhtml中就行了吗?

<h:body>
    <h:form>
        <div id="top">
            <ui:insert name="header"><ui:include src="sections/header.xhtml"/></ui:insert>
        </div>
        <div>
            <div id="left">
                <ui:insert name="sidebar"><ui:include src="sections/sidebar.xhtml"/></ui:insert>
            </div>
            <div id="content" class="left_content">
                <ui:insert name="content">Content</ui:insert>
            </div>
        </div>
        <div id="bottom">
            <ui:insert name="footer"><ui:include src="sections/footer.xhtml"/></ui:insert>
        </div>
    <h:form></h:body>

实际上,我在考虑一个用例,在这个用例中,我需要一个页面中的多个h:form。

谢谢

如何在JSF页面中使用<h:form>?单一表格?多种形式?嵌套表单?

Smart猫小萌
浏览 797回答 2
2回答
随时随地看视频慕课网APP

相关分类

Java
SQL Server
我要回答