1

rich:tabPanelリッチフェイス ショーケースで、動的タブを使用する最善の方法は を使用することですa4j:repeatが、これは私のアプリケーションでは機能しません。

これは私のコードです:

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
    <title>Java EE 6 Starter Application</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />   
</h:head>
<h:body>
    <h:form>
        <div id="topArea">
            <ui:insert name="topArea"/>
        </div>
        <div id="mainArea">
            <ui:insert name="mainArea"/>  
        </div>
        <div id="footerArea">
            <ui:insert name="footerArea"/>
        </div>
    </h:form>
</h:body>
</html>

にはtopArea、次のメニューがあります。

<rich:panelMenu>
    <rich:panelMenuItem label="Clienti" name="Clienti"  action="#{tabsBean.addTab()}"     render="tabsPanel" />                                     
</rich:panelMenu>

mainArea、私はこれを持っていますtabPanel

<rich:tabPanel id="tabsPanel" switchType="client"  activeItem="#{tabsBean.activeTab}" >
    <a4j:repeat  value="#{tabsBean.tabs}" var="tab">
        <rich:tab name="#{tab.name}">
            <f:facet name="header">#{tab.name}</f:facet>
            <h:form>
                <h:outputText value="Enter Name:" />
                <h:inputText id="input" />
                <h:outputText value="Enter you interests:" />
                <h:inputTextarea cols="17" rows="3" />
                <h:outputText value="Choose your favourite color" />
                <h:selectOneMenu>
                    <f:selectItem itemLabel="Red" itemValue="0" />
                    <f:selectItem itemLabel="Black" itemValue="1" />
                    <f:selectItem itemLabel="Green" itemValue="2" />
                    <f:selectItem itemLabel="White" itemValue="3" />
                </h:selectOneMenu>
            </h:form>
        </rich:tab>
    </a4j:repeat>
</rich:tabPanel>

私の悩みは:

  • タブは作成されません
  • ショーケースがネストされたフォームを使用するのはなぜですか? ネストされたフォームは問題を引き起こしませんか?

ありがとう

4

1 に答える 1

0

動的タブa4j:repeatは 4.3.0.Final からのみサポートされています。詳細については、こちらを参照してください: http://www.bleathem.ca/blog/2013/01/dynamic-panels-with-a4jrepeat.html

以前のバージョンのc:forEach items="#{tabsBean.tabs}" var="tab"場合は使用できます。

于 2013-03-07T05:09:07.290 に答える