messageLovChoiceの挿入

messageLovChoiceコンポーネントを挿入するには、次のようにします。

  1. 目的のファイルの設計構造ウィンドウで、messageLovChoiceコンポーネントを挿入するノードを探します。
  2. コンポーネント・パレットのドロップダウン・リストから「Form Components」を選択し、messageLovChoiceコンポーネントを、選択した親ノードにドラッグ・アンド・ドロップします。

    「messageLovChoice」ノードが、展開された親ノードに挿入され、強調表示されます。

  3. プロパティ・インスペクタで、messageLovChoiceコンポーネントに対して次の属性を設定します。

    ヒント: 選択済としてレンダリングされるオプションの場合、ADF UIXでは、オプション・コンテナのselection属性、オプション・コンポーネントのselected属性、オプション・コンテナのselectedValue属性、オプション・コンテナのselectedIndex属性という優先順位で属性が使用されます。

    注意: データ・バインディングを使用するには、「コンポーネント属性のデータ・バインディング」を参照してください。

    メッセージ属性の詳細は、「メッセージ・フォーム・コンポーネントに対するメッセージ属性の設定」を参照してください。メッセージ・フォーム・コンポーネントの他の一般的な属性の詳細は、「メッセージ・フォーム・コンポーネントに対する一般属性の設定」を参照してください。

  4. リストのオプションを挿入するには、「option挿入」を参照してください。

次の処理が必要ですので注意してください。

例(UIX XML)


...
<content>
  ...
  <flowLayout id="mlovchFlowLayoutID">
    <contents>
      <messageLovChoice name="mlovch1"
                        destination="LOVChoiceDialogPage.uix"
                        selectedValue="${sessionScope.userDataForLovChoice.favoriteVacation.location}"
                        prompt="Your favorite vacation spots"
                        tip="Select More for more options">
        <contents childData="${sessionScope.userDataForLovChoice.vacationSpots}">
          <option text="${uix.current.location}"
                  value="${uix.current.location}"/>
        </contents>
        <primaryClientAction>
          <firePartialAction targets="selectedValueTextID mlovchFlowLayoutID"
                             event="lovChoiceUpdate"/>
        </primaryClientAction>
      </messageLovChoice>
    </contents>
  </flowLayout>
  <messageStyledText prompt="The location you have chosen is:"
                     id="selectedValueTextID"
                     text="${sessionScope.userDataForLovChoice.favoriteVacation.location}"/>
  ...
</content>
<handlers>
  <!-- the examples require an HttpSession to be created for each user -->
  <event name="null">
    <method class="oracle.cabo.servlet.demo.lovchoice.LovChoiceEvents"
            method="createUserData"/>
  </event>
  <event name="lovUpdate">
    <method class="oracle.cabo.servlet.demo.lovchoice.LovChoiceEvents"
            method="handleLovUpdateEvent"/>
  </event>
  <!-- This event gets called from lovChoice when a selection is made from the choice other than More... -->
  <!-- Change the data depending upon what is selected, since other components on this page,
       like selectedLocation depend upon this data.-->
  <event name="lovChoiceUpdate">
    <method class="oracle.cabo.servlet.demo.lovchoice.LovChoiceEvents"
            method="handleLovChoiceUpdateEvent"/>
  </event>
  <event name="changeCheckState">
    <null/>
  </event>
</handlers>
...    

次に示すのは、LOVChoiceDialogPage.uixファイルです。


Example in UIX XML:

<page xmlns="http://xmlns.oracle.com/uix/controller"
      xmlns:ctrl="http://xmlns.oracle.com/uix/controller"
      xmlns:demo="http://xmlns.oracle.com/uix/demo"
      xmlns:data="http://xmlns.oracle.com/uix/ui" expressionLanguage="el"
      xmlns:ui="http://xmlns.oracle.com/uix/ui">
  <templates xmlns="http://xmlns.oracle.com/uix/ui">
    <templateImport source="lovChoice_TableLib.uit"/>
  </templates>
  <ctrl:content xmlns="http://xmlns.oracle.com/uix/ui">
    <dataScope>
      <provider>
        <data name="tableStates">
          <!-- This takes the inline data provider tableData and stores it on the session -->
          <method class="oracle.cabo.servlet.demo.lovchoice.LovTableState"
                  method="createTableState"/>
        </data>
        <!-- create some static data for the VacationSpots table -->
        <data name="VacationSpots">
          <inline>
            <row location="Hawaii" activity1="scuba" activity2="boogie-boarding" />
            <row location="Palm Springs" activity1="golf" activity2="lounging by the pool" />
            <row location="Bali" activity1="swimming" activity2="drinking from the pool bar" />
            <row location="Thailand" activity1="rock climbing" activity2="elephant viewing"/>
            <row location="Virgin Islands" activity1="sailing" activity2="snorkeling"/>
            <row location="Telluride, CO" activity1="hiking" activity2="biking"/>
            <row location="Steamboat Springs, CO" activity1="skiing" activity2="boarding"/>
            <row location="San Francisco" activity1="dining" activity2="shopping"/>
            <row location="Seattle, WA" activity1="dodging raindrops" activity2="coffee drinking"/>
            <row location="Hollywood, CA" activity1="star gazing" activity2="movie watching"/>
            <row location="Yosemite Valley" activity1="rock climbing" activity2="hiking"/>
            <row location="San Francisco Bay" activity1="sailing" activity2="windsurfing"/>
            <row location="Santa Cruz" activity1="surfing" activity2="disc golf"/>
            <row location="Austin, TX" activity1="club hopping" activity2="water skiing"/>
            <row location="Everest" activity1="camping" activity2="mountaineering"/>
            <!-- DataObjectList to provide information to the column header stamps -->
            <demoColumnHeaderData headerText="Location"/>
            <demoColumnHeaderData headerText="Activity1"/>
            <demoColumnHeaderData headerText="Activity2"/>
          </inline>
        </data>
      </provider>
      <contents>
        <flowLayout>
          <contents>
            <listOfValues id="Lov1-target"
                          title="Adventure Vacation Spots" >
              <headerInstructions>
                <styledText text="This is a list of popular vacation spots. Pick your favorites!"
                            styleClass="OraInstructionText"/>
              </headerInstructions>
              <!-- This choice just pulls out the column headers -->
              <filterChoice>
                <choice name="categoryChoice"
                        multiple="false">
                  <contents childData="${uix.data.VacationSpots.demoColumnHeaderData}">
                    <option text="${uix.current.headerText}"/>
                  </contents>
                </choice>
              </filterChoice>
              <searchInstructions>
                <styledText text=" The search does not work in this demo."
                            styleClass="OraInstructionText"/>
              </searchInstructions>
              <contents>
                <flowLayout>
                  <contents>
                    <!-- Here's the table definition -->
                    <!-- This must be a form submitted proxied table -->
                    <!-- this template, demo:table, is very useful for keeping track of -->
                    <!-- the table's state. See the Table Example Development documentation -->
                    <!-- for very good details on how this works -->
                    <demo:table name="lovChoiceTable" id="lovChoiceTableID"
                                blockSize="5"
                                formSubmitted="true"
                                proxied="true"
                                tableData="${uix.data.VacationSpots.row}"
                                tableState="${uix.data.tableStates[0]}">
                      <contents>
                        <column>
                          <columnHeader>Location</columnHeader>
                          <contents>
                            <text text="${uix.current.location}"/>
                          </contents>
                        </column>
                        <column>
                          <columnHeader>Activity1</columnHeader>
                          <contents>
                            <text text="${uix.current.activity1}"/>
                          </contents>
                        </column>
                        <column>
                          <columnHeader>Activity2</columnHeader>
                          <contents>
                            <text text="${uix.current.activity2}"/>
                          </contents>
                        </column>
                      </contents>
                    </demo:table>
                  </contents>
                </flowLayout>
              </contents>
            </listOfValues>
          </contents>
        </flowLayout>
      </contents>
    </dataScope>
  </ctrl:content>
  <handlers>
    <!-- the examples in this file require an HttpSession to be created for each user -->
    <!-- handle all the table events -->
    <event name="goto sort show hide">
       <!-- the goto event gets called during table navigation. keep track of the table's state. -->
      <method class="oracle.cabo.servlet.demo.lovchoice.LovChoiceEvents"
              method="handleTableEvent"/>
    </event>
    <event name="lovFilter">
      <!-- this is for the search's Go button. Since there is no search -->
      <!-- functionality in this LovChoice demo, I am setting this to null. -->
      <null/>
    </event>
    <event name="lovSelect">
      <!-- the lovSelect event gets generated when the user presses the Select button. -->
      <!-- this event handler should gather the selection information and add -->
      <!-- to the user's choice list -->
      <!-- ......................... -->
      <!-- After the lovSelect event is queued, the LOV window will be closed. -->
      <!-- On closing, the lovWindow will send an lovUpdate event (this should be handled in the main page). -->
      <!-- This event tells the developer that the LOV window has gone away,-->
      <!-- and it's time to update all data providers. -->
      <!-- This event submits the form on the main page in which the original -->
      <!-- LovInput element was drawn. -->
      <!-- The source parameter will contain the name attribute of the original lovInput element. -->
      <method class="oracle.cabo.servlet.demo.lovchoice.LovChoiceEvents"
              method="handleLovSelectFromDialogEvent"/>
    </event>
  </handlers>
</page>    

次に示すのは、lovChoice_TableLib.uitファイルです。


Example in UIX XML:

<templateLibrary xmlns="http://xmlns.oracle.com/uix/ui"
                 xmlns:demo="http://xmlns.oracle.com/uix/demo"
                 xmlns:data="http://xmlns.oracle.com/uix/ui">

  <templateDefinition targetNamespace="http://xmlns.oracle.com/uix/demo"
                      localName="table" expressionLanguage="el">
    <type base="data:table">
      <attribute name="tableState" javaType="oracle.cabo.servlet.demo.lovchoice.LovTableState"/>
    </type>
    <content>
      <table tableData="${uix.rootAttr.tableState.currentRecordSet}"
             detailDisclosure="${uix.rootAttr.tableState.detailDisclosureList}"
             blockSize="${uix.rootAttr.tableState.blockSize}"
             maxValue="${uix.rootAttr.tableState.lastIndex}"
             value="${uix.rootAttr.tableState.startIndex}">
       <tableSelection>
         <multipleSelection selected="${uix.current}" selection="${uix.rootAttr.tableState.selections}"/>
       </tableSelection>
       <childList><rootChildList/></childList>
       <attributeMap><rootAttributeMap/></attributeMap>
       <childMap><rootChildMap/></childMap>
     </table>
   </content>
  </templateDefinition>
</templateLibrary>    

messageLovChoiceについて
メッセージ・フォーム・コンポーネントと属性について

メッセージ・フォーム・コンポーネントへの名前付きの子endの挿入
フォーム・コンポーネントの使用

 

Copyright © 1997, 2004, Oracle. All rights reserved.