6 Replies Latest reply: Sep 6, 2012 12:50 AM by user8662640 RSS

    Binding multiple web service data controls to the same page

    user8662640
      hi,
      JDev version : 11.1.1.6.0
      i using SOAP web services. i have the following use case :
      i have data control for the web service , which saves the values inputted in the form. i have created the input form using this data control (DC1).
      There is a input text field[T1] , on tab out of which I need to populate another text field, for which the data is returned from another web service data control (DC2).
      For the same input text[T1], on tab out, I need to populate list of objects into selectonechoice component, for which the data is returned from another web service data control (DC3).

      Is it possible to use bind multiple data controls to the same page to achieve the use case?
      However i want to avoid the usage of managed bean. Is it possible to achieve this?

      Regards
      Prafull
        • 1. Re: Binding multiple web service data controls to the same page
          Frank Nimphius-Oracle
          Hi,

          yes you can. A simple example is here: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/70-dependent-listboxes-using-ws-286107.pdf

          Frank
          • 2. Re: Binding multiple web service data controls to the same page
            user8662640
            hi,
            Thanks for the response.

            i have already gone through the use case,but my use case is as follows
            i m using multiple data controls in one jspx page.
            The use cases is as follows
            Four text fields : INPUT_TXT1,INPUT_TXT2,INPUT_TXT3 and INPUT_TXT4 in one jspx form.

            1)First Data Control takes INPUT_TXT1 and INPUT_TXT2 as the inputs and on the tab out of these fields, INPUT_TXT3 field gets populated.
            2)Second data control takes INPUT_TXT1 as the input, on the tab out of this field,INPUT_TXT4 field gets populated.                                        
            3)Third data control takes the form values [ INPUT_TXT1,INPUT_TXT2,INPUT_TXT3 and INPUT_TXT4 ] and saves the data.

            Assume that,

            The first data control which refers to service1 has REQ1 AND REQ2 as the request parameters and returns response RES1.
            Mapping for service1 is
            REQ1 maps to INPUT_TXT1
            REQ2 maps to INPUT_TXT2
            RES1 maps to INPUT_TXT3.

            The second data control which refers to service2 has REQ1 as the request parameters an returns the reponse RES2.
            Mapping for service2 is
            REQ1 maps to INPUT_TXT1
            RES2 maps to INPUT_TXT4

            The third data control refers to service3 which has REQ1,REQ2,REQ3 and REQ4 as the request parameters and saves the data.
            Mapping for service3 is
            REQ1 maps to INPUT_TXT1
            REQ2 maps to INPUT_TXT2
            REQ3 maps to INPUT_TXT3
            REQ4 maps to INPUT_TXT4

            i have achieved the use case of saving the data by using multiple data controls in the page by using a managed bean.
            i have over overidden the bindings in the managed bean to invoke service referenced by service3.

            Can i acheive the same use case without the use of the managed bean?
            Challenges faced are
            1) REQ1 and REQ2 are the parameters which is common to both service 1 and service 3.
            2) REQ1 is the parameter which is common to both service 2 and service 3.
            3) Service3 needs all the parameters REQ1, REQ2,REQ3 and REQ4 as the parameters to save the data.
            There are bindings issues as the same paramter is accessed amongst multiple services.
            Is it possible to resolve these binding issues adressed?

            Thanks
            Prafull
            • 3. Re: Binding multiple web service data controls to the same page
              user8662640
              hi,
              Need solution to this problem,please respond ASAP.

              Thanks
              Prafull
              • 4. Re: Binding multiple web service data controls to the same page
                Frank Nimphius-Oracle
                Hi,

                Can i acheive the same use case without the use of the managed bean?

                Yes, though the managed bean solution sounds reasonable to me.

                Challenges faced are

                +1) REQ1 and REQ2 are the parameters which is common to both service 1 and service 3.+

                Input text fields that provide arguments for a method are bound to a variable (PageDef file has a variable iterator in teh executable section). A variable can be referenced from many method arguments

                +2) REQ1 is the parameter which is common to both service 2 and service 3.+

                Same as 1. Create a parameter for for the service 2 and then map the variables in the method arguments of service 3

                +3) Service3 needs all the parameters REQ1, REQ2,REQ3 and REQ4 as the parameters to save the data.+

                As said, input fields can be referenced from variables, dependent fields, from the attribute binding (as I assume its a return value displayed in the dependent field)

                There are bindings issues as the same paramter is accessed amongst multiple services.

                This would be new to me

                Is it possible to resolve these binding issues adressed?

                Yes. Ensure however that the WS DC iterators you see in PageDef have their Refresh property set to ifNeeded for the dependent field refresh to work properly

                Frank
                • 6. Re: Binding multiple web service data controls to the same page
                  user8662640
                  hi Frank,
                  Thanks for the response, your advice was very helpful in solving the problem. Also had one more query.
                  i could achieve binding multiple data controls to the page by using managed bean and also without managed bean.
                  As you mentioned its reasonble to use managed bean in the above scenario.
                  Could you please let me know whats the advantage of using managed bean while binding multiple data controls to the page?

                  Thanks
                  Prafull