子でのPanelPageおよびメニュー・コンポーネントの使用

階層メニューを手動で作成するには、階層内のノードごとにJSFページを作成します。次に、各メニュー・コンポーネントPanelPageファセット内に配置し、適切なコンポーネントを"selected"としてマークします。この方法は時間がかかり、エラーが発生しやすいことに注意してください。このため、ツリーが大きい場合は、メニュー・モデルへのコンポーネントのバインド、またはメニュー・モデルへのページ・コンポーネントのバインドを検討してください。

PanelPageとメニュー・コンポーネントを使用してメニュー階層を作成する手順は、次のとおりです。

  1. 各ノードに対して複数のナビゲーション・ケースがあるグローバル・ナビゲーション・ルールを1つ作成します。次に例を示します。
    <navigation-rule>
      ...
      <navigation-case>
        <from-outcome>go.insurance</from-outcome>
        <to-view-id>pages/insurance.jsp</to-view-id>
      </navigation-case>
      ...
    </navigation-rule>        
  2. メニュー階層内のノードごとにJSFページを作成します。各ページの適切なコンポーネントを"selected"としてマークします。
    たとえば、「Insurance」ページが次の階層内にあるとします。

    メニュー・ツリー

    次のように表示されます。
    「Insurance」が現在のページとして表示されたWebページ
    コードは次のとおりです。
    <af:panelPage title="Insurance">
      <f:facet name="menu1">
        <af:menuTabs>
          <af:commandMenuItem text="Benefits" selected="true"
                               action="go.benefits"/>
          <af:commandMenuItem text="Employee Data" action="go.emps"/>
        </af:menuTabs>
      </f:facet>
      <f:facet name="menu2">
        <af:menuBar>
          <af:commandMenuItem text="Insurance" selected="true"
                              action="go.insurance"/>
          <af:commandMenuItem text="Paid Time Off" selected="false"
                              action="go.pto"/>
        </af:menuBar>
      </f:facet>
      <f:facet name="menu3">
        <af:menuList>
          <af:commandMenuItem text="Health" action="go.health"/>
          <af:commandMenuItem text="Dental" action="go.dental"/>
        </af:menuList>
      </f:facet>
      <f:facet name="menuGlobal">
        <af:menuButtons>
          <af:commandMenuItem icon="images/help.gif" text="Help"/>
        </af:menuButtons>
      </f:facet>
      <f:facet name="menuSwitch">
        <af:menuChoice>
          <af:commandMenuItem text="Financials"/>
        </af:menuChoice>
      </f:facet>
      <f:facet name="location">
        <af:menuPath>
          <af:commandMenuItem text="Benefits" action="go.benefits"/>
          <af:commandMenuItem text="Insurance"/>
        </af:menuPath>
      </f:facet>
      <af:outputText value="All full-time employees are entitled to enroll in insurance plans offered by our company."/>
    </af:panelPage>        

メニュー階層について
ADF Facesメニューのファセットおよびコンポーネントについて
ADF Facesコンポーネントの使用