2 Replies Latest reply: Aug 15, 2014 6:42 AM by Thomas_H RSS

    How do I make Select One Choice from a web service?

    Thomas_H

      Hi, I am using Jdeveloper 12.1.3 with the mobile extension. I have exposed the following method as a web service.

       

      public List<ViewRowImpl> findMyVo(String myParam)
           {
              List<ViewRowImpl> result = new ArrayList<ViewRowImpl>();
              ViewObjectImpl vo = getMyVo();
              vo.setNamedWhereClauseParam("param",myParam);
              vo.setForwardOnly(true);
              vo.executeQuery();
              while (vo.hasNext()) {
                result.add((ViewRowImpl)vo.next());
              }
              return result;
           }
      

       

      When I consume this web service in my mobile project, the method is shown as a method with a method return as a child item.

       

      I can use the method return on a amx page to make a MAP List View, MAF Iterator, form and so on. I am missing Multiple Selection and Single Selection. (See attached image)

      JDev create list.png

       

      So my question is: How can I make a MAF Select One Choice from a method return based on a view object from a web service. Alternatively:  How can I get the returned view object to appear as a collection in the Data Control?

       

      Thanks in advance

       

      Best regards,

      Thomas H

        • 1. Re: How do I make Select One Choice from a web service?
          Frank Nimphius-Oracle

          Thomas,

           

          leaving aside how you created the web service, we can simplify the case to a method exposed on a SOAP service that returns a list in response. The multiple select option actually would not be quite helpful in this case as the list is not a collection you can update but just a set of values. The most common use case for select lists is to update an attribute of an updatable collection. Is this your use case as well? In this case you would drag the attribute you want to update as a select list and then use the dynamic list binding to associate it with the iterator providing the seletable values. In MAF there is an intermediate step required (here it differs from ADF) which is that you need to create the iterator before you can create the SOC. If you did not create the iterator, just create a new iterator in teh PageDef file (from the binding editor). If I recall correct then you need to create a new accessor iterator for the result (which then also explains why you cannot create a select component directly from it). When you created this drag and drop the attribute to update as a select choice and wire it to the iterator you built.

           

          Hope this makes sense

           

          Frank

          • 2. Re: How do I make Select One Choice from a web service?
            Thomas_H

            Hi Frank, thanks for your reply.

             

            I am trying to create a list (select one choice) containing all the weeks in a school year. When the user select a week, the time schedule for this week are displayed. If I try to create the list from a attribute instead of a collection, I get to choose between Dynamic List, Fixed List and Model Driven list. I don't think I can use any of those. At least I don't understand how.

             

            As a temprary solution I am using a panel splitter with the result set populated as a MAF List View, this works, but it takes more space than a select one choice list. And the time schedule needs all the horizontal space.

             

            Do you have an idea of how I can achieve this?

             

            Best regards,

            Thomas H