messageLovInputの挿入

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

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

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

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

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

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

例(UIX XML)


Example: Copyright (c) Oracle Corporation 2002-2003. All Rights Reserved.

<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) Oracle Corporation 2002-2003. All Rights Reserved. -->
<!-- lovInputTest.uix -->
<page xmlns="http://xmlns.oracle.com/uix/controller"
      xmlns:ctrl="http://xmlns.oracle.com/uix/controller"
      xmlns:ui="http://xmlns.oracle.com/uix/ui"
      expressionLanguage="el">
  <content>
    <dataScope xmlns="http://xmlns.oracle.com/uix/ui">
      <contents>
        <document>
          <contents>
            <body>
              <contents>
                <form name="form1">
                  <contents>
                    <!-- importScript names="TableProxy()"/-->
                    <script>
                      <contents>
<!-- Define JavaScript functions to handle all the possible callbacks -->
                        function SelectCallBack(lovWin, field, event, mainWin)
                        {
                        // This function will be called after the select button has been clicked.
                        // - lovWin points to the not-yet-closed LOV dialog window.
                        // - field points to the lovInput field that triggered this
                        //   LOV dialog.
                        // - event is the window close event
                        // - mainWin is the main window that opened the LOV
                        //
                        // Note: Because IE destroys the items on the window at close() time, but
                        // before the close callback, this callback gets called BEFORE the LOV Window
                        // is closed under IE. There should be no processing differences, but any
                        // confirmation dialogs will come up between the main window, and the still
                        // displayed LOV window. This can be very confusing.
                        // For this reason, this function is not setup. To test this function, you
                        // need to do two things:
                        //  1.) Add the following attribute to the lovInput element:
                        //    onLovSelect="SelectCallBack"
                        //  2.) Load the TableProxy library by uncommenting the importScript above.
                        //
                        var selVal = '*NULL*';
                          if (lovWin)
                          {
                            if (lovWin.document)
                            {
                              var doc = lovWin.document;
                              if (doc.forms)
                              {
                                var forms = doc.forms;
                                if (forms &amp;&amp; forms.length)
                                {
                                  var form = doc.forms[0];
                                  if (form)
                                  {
                                    var proxy = new TableProxy("lovTbl", form.name, lovWin);
                                    var selRows = proxy.getSelectedRows();
                                    for(var i=0; i &lt; selRows.length; i++)
                                    {
                                      var rowid = proxy.getFormElement("rowid", selRows[i]);
                                      selVal = rowid.value;
                                    }
                                  }
                                }
                              }
                            }
                          }
                          field.value = selVal;
                          return confirm("Click 'OK' to further process, 'Cancel' to use rowid.");
                        }
                        function _printCallbackParams(params, CBName)
                        {
                          // This function just raises a confirm dialog listing
                          // key:value pairs in the params object
                          var str = CBName + ' called with:'
                          for (var key in params)
                          {
                            str += "\nparameter: '" + key +
                                   "', value '" + params[key] + "'";
                          }
                          return confirm(str);
                        }
                        function InitCallBack(params)
                        {
                          // If passed as the onLovInit attribute, this function is called
                          // after the LOV icon is clicked, but before the LOV dialog window
                          // is launched. This gives the developer a change to change the
                          // parameters that are going to the dialog window.
                          // The params object contains all the parameters which will end up
                          // on the URL.

                          // Add our own parameter. This will end up as a parameter on the
                          // LOV dialog window URL.
                          // (http://...?...&myParam=foo)
                          params["myParam"] = "foo";

                          return _printCallbackParams(params, 'InitCallback');
                        }
                        function ValidateCallBack(params)
                        {
                          // If passed as the onLovValidate attribute, this function is called
                          // before the lovValidate event is fired.
                          // This gives the developer a chance to add, subtract or change
                          // parameters that will be sent with the lovValidate event
                          return _printCallbackParams(params, 'pre-validate Callback');
                        }
                      </contents>
                    </script>
                    <stackLayout>
                      <contents>
                        <header>
                          <contents>
                            <flowLayout>
                              <contents>
                                <flowLayout>
                                  <contents>
                                    <styledText styleClass="OraPromptText"
text="First lovInput field: "/> <messageLovInput name="lov1"
id="Lov1-target"
formSubmitted="true"
destination="listOfValues_Dialog.uix"
shortDesc="Click to select a predefined value" partialRenderMode="multiple"
partialTargets="Lov1-dependent1
Lov1-dependent2
Lov1-dependent3"
showWindow="${uix.eventResult[
'Lov1-target'].showWindow}" text="${ui:defaulting(uix.data.fieldData[
'Lov1-target'].fieldText, uix.data.fieldData.defaultText)}"/> </contents> </flowLayout> <spacer width="8"/> <styledText styleClass="OraInstructionText" text="summit elevation: "/> <styledText styleClass="OraDataText" id="Lov1-dependent1" text="${uix.data.fieldData['Lov1-target'].row1.altitude}"/> </contents> </flowLayout> <header> <contents> <stackLayout> <contents> <styledText styleClass="OraInstructionText" text="These two fields return data from the second selected row. This is a very simple example, your application would actually add rows to a table, update a dataset, or do some other complex operation using all the selected rows."/> <flowLayout> <contents> <styledText styleClass="OraInstructionText" text="Row 2, peak: "/> <styledText id="Lov1-dependent2" styleClass="OraDataText" text="${uix.data.fieldData['Lov1-target'].row2.peak}"/> <spacer width="15"/> <styledText styleClass="OraInstructionText" text="summit elevation: "/> <styledText id="Lov1-dependent3" styleClass="OraDataText" text="${uix.data.fieldData['Lov1-target'].row2.altitude}"/> </contents> </flowLayout> </contents> </stackLayout> </contents> </header> </contents> </header> </contents> </stackLayout>
</contents> </form> </contents> </body> </contents> </document> </contents> <provider> <data name="fieldData"> <method class="oracle.cabo.servlet.demo.ListOfValuesDemoData" method="getFieldSet"/> </data> ... </provider> </dataScope> </content> <handlers> <!-- The null event mapped to reset clears all on each initial visit --> <event name="null reset"> <method class="oracle.cabo.servlet.demo.ListOfValuesDemoData" method="doReset"/> </event> <event name="lovValidate"> <method class="oracle.cabo.servlet.demo.ListOfValuesDemoData" method="handleLovValidateEvent"/> </event> <event name="lovUpdate"> <method class="oracle.cabo.servlet.demo.ListOfValuesDemoData" method="handleLovUpdateEvent"/> </event> <event name="setSearchMode"> <method class="oracle.cabo.servlet.demo.ListOfValuesDemoData" method="handleLovSearchModeEvent" /> </event> </handlers> </page>

listOfValues_Dialog.uixファイルについては、「listOfValuesの挿入」を参照してください。


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

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

 

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