Executing the view object query in Oracle ADF

By Vinay | May 12, 2009 | 2,757 views
Category Java, Oracle ADF

  Share


About author  I am Java/oracle professional.Working on Java/J2EE technologies and i.e Oracle ADF,Spring,hibernate,J2ee,PL/sql,Apps for 2+ years.I am passionate about learning new technologies.I am sharing my knowledge. Give your views and suggestion. http://www.linkedin.com/in/vinaykumar2 Read more from this author


In oracle ADF, for executing the view object query we need to write code for that.This code is needed for refreshing the table content after executing some DML operation.For that we need to execute the query of view object.For that write an in application module Impl.java file.For an example look the below code-


    public void refreshVinayView()
    {
VinayViewObject  vinay= get VinayViewObject 1();
        vinay.executeQuery();
    }

After writing in AppmoduleImpl.java file.save your application and double click on app module.Go to client interface and shuttle right to this method “refreshVinayView” .
After that From where you what to execute the view object query.For example- we are deleting some row from table and want to reexecute the query again then we can write the code in specific java file of some .jspx file.Sample code is as below.

   FacesContext fctx = FacesContext.getCurrentInstance();
        ValueBinding vb =
            fctx.getApplication().createValueBinding("#{bindings}");
        DCBindingContainer dcb = (DCBindingContainer)vb.getValue(fctx);
        OperationBinding operation =
            (OperationBinding)dcb.get("refreshVinayView ");
        operation1.execute();

One more thing needed.Go to page definition of that specific .jspx file. And in Binding tab in structure window.Right click the binding tab and go to method action.An “Action binding editor” window will open.Select your java method in SELECT AN ACTION drop down and press ok.

This is all you need to execute the view object the query.

  • Delicious
  • Yahoo Buzz
  • Digg
  • DZone
  • Facebook
  • LinkedIn
  • Twitter
  • Share/Bookmark
Read more post on executing view object query in adf Oracle ADF refreshing the view object 

  Share

4 comments | Add One

Comments

  1. SM ShohidNo Gravatar - 11/12/2009 at 10:28 pm

    Vinay I appreciate your labor for us like new in adf. I am very much new. I need to auto refresh a report in an 5 second interval. I want to do it by executing view object. I can showing message in 5 second interval by using poll component. I need to call viewObject.execute query where I wrote message generate method in a java class. I could not do this. I tried to write your refreshVinayView method in my javaclass but there the class could not get view object. Would you please help me regarding this.



  2. Manav RatraNo Gravatar - 02/24/2010 at 4:35 am

    Hey great to see your blog…
    Add some more good stuff



  3. vinayNo Gravatar - 02/24/2010 at 7:21 am

    manav- i suggest if you add some more stuff for executing the query or some knowledge in ADF



  4. Manav RatraNo Gravatar - 03/4/2010 at 5:14 am

    Well the above defined steps by Vinay holds good for ADF 10g

    But for ADF 11g only change you need to make is use below code in your backingbean

    DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    OperationBinding operation =
    bindings.getOperationBinding(“refreshVinayView”);
    operation.execute();



Trackbacks

Leave a Comment

Name:

E-Mail :

Website :

Comments :