7 Replies Latest reply: Feb 26, 2012 10:26 PM by Subramanian Meyyappan RSS

    call VO programmatically

    hdamis
      Hi,
      I create a simple VO sql query but I want to call it when I click on buttom. can you direct me how to do it.
      Thanks,
        • 1. Re: call VO programmatically
          Puthanampatti
          DCIteratorBinding iterator =
          ADFUtils.findIteraotr("youiter");
          ViewObject vo = iterator.getViewObject();
          NavigatableRowIterator list =
          iterator.getNavigatableRowIterator();

          Row row = list.first();
          Object[] val = row.getAttributeValues();
          ViewRowSetImpl vor = (ViewRowSetImpl)val[row.getAttributeCount() - 1];
          vor.setNamedWhereClauseParam("bindParam", value);
          vor.executeQuery();
          • 2. Re: call VO programmatically
            Shay Shmeltzer-Oracle
            What do you mean call it? What specifically do you want to do with it?
            You can probably use a service method that you then bind to a button on your page:
            https://blogs.oracle.com/shay/2010/07/am_service_method_-simpledem.html
            • 3. Re: call VO programmatically
              hdamis
              I mean ...
              I create new VO simple select statment withount any bind variable.
              I need to call this VO programmatically when I click on buttom this buttom will call this VO and the result will retuen in adf table. hope the question now is clear.
              • 4. Re: call VO programmatically
                Timo Hahn
                Hani,
                you should always tell us which JDev version you are using...

                I don't understand your use case. IF you just want to see the result of an execute query on the VO, you can drag the VO from the data control onto a page. This will execute the query automatically once you enter the page. For this you don't need a line of code.
                If you like to execute the query again when the user hit a button you open the VO in the data control, open the operations node and drag the execute operation onto the page and select 'ADF Button' when you drop it. this will create a button which when clicked executes the VO query again.

                Timo
                • 5. Re: call VO programmatically
                  hdamis
                  Dear Timo,
                  Thanks for your replay.
                  I exactlly need the second option.

                  Edited by: Hani on Feb 25, 2012 6:02 AM
                  • 6. Re: call VO programmatically
                    Timo Hahn
                    and you jdev version?

                    Timo
                    • 7. Re: call VO programmatically
                      Subramanian Meyyappan
                      If you like to execute the query again when the user hit a button you open the VO in the data control, open the operations node and drag the execute operation onto the page and select 'ADF Button' when you drop it. this will create a button which when clicked executes the VO query again.
                      timo mentioned clearly. is there any doubt with this? Pretty clear'd steps.
                      ok

                      please read it.
                      https://forums.oracle.com/forums/ann.jspa?annID=56

                      Edited by: ADF7 on Feb 26, 2012 8:26 PM