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