Monday 14 April 2014

To Create a web service of java class in JDeveloper.

http://www.oracle.com/technetwork/developer-tools/jdev/ccset16-all-096507.html

Saturday 22 March 2014


To make the updated data reflect programmatically use Partial Trigger. 

        Connection conn=null;        Class.forName ("oracle.jdbc.driver.OracleDriver");
        try{
        conn = DriverManager.getConnection
                ("jdbc:oracle:thin:@localhost:1521:xe", "SYSTEM", "singh");
    }catch(Exception e){
        e.printStackTrace();
        }    
        String sql="UPDATE A SET COUNTRY='Pakistan' WHERE ID=1";
           Statement stm  =conn.prepareStatement(sql);
       int i= stm.executeUpdate(sql);
        DCBindingContainer dcbc=(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
        DCIteratorBinding dcit=dcbc.findIteratorBinding("ViewObj1Iterator");
        dcit.executeQuery();
        AdfFacesContext.getCurrentInstance().addPartialTarget(getTable());

Wednesday 19 February 2014

Calling a view Activity dynamically in Task Flow.

1. to call view 2 from from view if action out come comes yes then view reflects other wise view1. 

2 From Outcome of Command links are yes & no.





    
                                                                           
3 set a method in a bean on Action of view1(.jsff or .jspx page) whose return type is String  and return yes or no  on the business condition & accordingly screen reflects to the user.

    public String actionmethod() {
        // Add event code here...
       if(a==b){
return "yes";
}else
        return "no";
    }                                                                                                       


Using Value change Listener in ADF

while using value change listener by default  auto submit is false in behavior of Property Inspector
post making it true change listener method works on selecting choices from drop down as shown below



    public void changelistener(ValueChangeEvent valueChangeEvent) {
        // Add event code here...
        System.out.println("Valuechaneglistene"+(String)valueChangeEvent.getNewValue());
     
    }

sop starts getting reflected according to the value map in drop down.

Wednesday 12 February 2014

Abandoning a Bounded Taskflow with Stand-Alone Pages

 How to manage more than one Bounded task flows from single page.

https://blogs.oracle.com/jheadstart/entry/core_adf_11_abandoning_a_bound

Tuesday 11 February 2014

Programmatically Navigating to another page in adf / jsf

Here is the sample code which can be used to programmatically navigating to another page in jsf or adf

FacesContext fctx = FacesContext.getCurrentInstance();
Application application = fctx.getApplication();
NavigationHandler navHandler = application.getNavigationHandler();
navHandler.handleNavigation(fctx,null, "name of navigation case");

Monday 10 February 2014

oracle.jbo.TxnValException: JBO-27023: Failed to validate all rows in a transaction.
Detail :- oracle.jbo.RowValException: JBO-27024:





user may try to insert more then  single row in DB with Same primary Key.
for Instance:----






            ViewObject vo = (ViewObject)dit.getViewObject();
            CityViewRowImpl cvrt=(CityViewRowImpl)vo.createRow();
            cvrt.setCity1("California1");
            cvrt.setState("Arizona1"); // if state is primary key then if this method called many times Excep.throw
            vo.insertRow(cvrt);
            vo.getApplicationModule().getTransaction().commit();

To Insert a row in a DB Programatically & reflect the inserted row after DB Transaction.

               try{
   DCBindingContainer dcb= (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
                  DCIteratorBinding dit =dcb.findIteratorBinding("CityView1Iterator");
            ViewObject vo = (ViewObject)dit.getViewObject();
            CityViewRowImpl cvrt=(CityViewRowImpl)vo.createRow();
            cvrt.setCity1("California1");
            cvrt.setState("Arizona1");
            vo.insertRow(cvrt);
            cvrt.validate();
            vo.getApplicationModule().getTransaction().commit();
            dit.executeQuery();
        }catch(Exception e){
    System.out.println("error Occurs");
    e.printStackTrace();
                  }

Sunday 9 February 2014

How to Iterate throw view Object Programatically in ADF.

       
        DCBindingContainer dcb= (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
        DCIteratorBinding dit =dcb.findIteratorBinding("ViewObjectIterator");
        ViewObject vo = (ViewObject)dit.getViewObject();
        Row[] row = vo.getAllRowsInRange();
        for(Row r : row){
                System.out.println("r"+r.getAttribute("State"));
                }

Thursday 6 February 2014

How to programatically insert a row in a table with the help of view object object



        try{
        FacesContext fcc=FacesContext.getCurrentInstance();
        HttpServletRequest req=(HttpServletRequest)fcc.getExternalContext().getRequest();
        HttpSession session =req.getSession();
       
        String amDef = "model.applicationmodule.AppModule";
        String config = "AppModuleLocal";
        ApplicationModule am =Configuration.createRootApplicationModule(amDef, config);
        String[] volist =  amm.getViewObjectNames();
            ViewObject vo=null;
        
                        vo=amm.findViewObject(volist[i]); 

            vo.executeQuery();
        

CityViewRowImpl cvri=(CityViewRowImpl)vo.createRow();
        

        cvri.setAttribute("State", "NewYork");
        cvri.setAttribute("City1", "Washington");
        vo.insertRow(cvri);


    am.getTransaction().commit();
        }catch(Exception e){
    e.printStackTrace();
                  }

.

Tuesday 4 February 2014

ADF 11g API

http://docs.oracle.com/cd/E12839_01/apirefs.1111/e10653/toc.htm

Friday 31 January 2014

How To  Call different Task Flow's Dynamically on a Single Region on any action.

Step1. Create two different bounded task flow.Drop a view into these task flows . double click on view   activity and create a .jsff fragments and drop a VO from Data Control as a table in one TF and as Form in another TF. 













 as Shown in fig we have two TF DynamicTF1 & DynamicTF2 bounded task flow with a view activity in it.

Step2: Create a page and use panel splitter we get two regions in 1 region we will drop buttons
say Table & Forms are the buttons in Second region  you drop a single task flow as a dynamic region say we



Give the Bean name, Class name & prameter if required otherwise you can skip parameter of TF.

Step3:  use set property listener in command button as shown in fig. below.



Step:4 In Class use the code as shown below


Step5: Run the Home page & click on the buttons.
on Click of Table.









on click of Form.


Happy Coding..........