Inserting a MessageLovInput

To insert a messageLovInput component:

  1. In the Design Structure Window of the desired file, locate the node in which you wish to insert a messageLovInput component.
  2. In the Component Palette, select Form Components from the dropdown list, and then drag and drop the messageLovInput component to the parent node of your choice.

    The messageLovInput node is inserted and highlighted under the expanded parent node.

  3. In the Property Inspector, set the following attributes for the messageLovInput component:

Note: To use data binding, see Data Binding a Component Attribute.

For information about message attributes, see Setting the Message Attributes for a Message Form Component. For information about other general attributes of message form components, see Setting the General Attributes for a Message Form Component.

Example (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>

See Inserting a ListOfValues for thelistOfValues_Dialog.uix file.


About MessageLovInput
About Message Form Components and Attributes

Inserting an End Named Child for a Message Form Component
Inserting a ListOfValues
Working with Form Components

 

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