Posts Tagged ‘view criteria’

JDev & ADF Goodies

Since JDeveloper 12.1.3 the invoke action used in earlier version has been deprecated. Users still using the old invoke action to load data on page load should migrate their code to using the default activity in a bounded task flow instead. This article describes how to use the executeWithParams method as a default activity in a bounded task flow (btf) to load data to be shown in a region. For this we implement a common

Use Case:
in a text field the user enters a string which should be used to look-up data in the DB and show the data as a table in a region.
For this we use the HR schema and build a look-up for locations after the name of the city of the location. In a page the user can insert the name or part of a cities name into a text field. This input is…

View original post 634 more words

There are several different methods on getting ViewObjects in ADF programmatically. It is possible to create a method within the Application Module Impl or your view object Impl class and then call that method through your managed bean or you can even call it directly within your managed bean but the first method is suitable.

1- Within the application module

ViewObjectImpl vo = getYourViewObject();
ViewCriteria vc = vo.getViewCriteria(“MyCriteria”);
vo.applyViewCriteria(vc);
vo.setNamedWhereClauseParam(“some_param”, anyParam);
vo.executeQuery();
Row row = vo.getCurrentRow();

2- Within your View Object

ViewCriteria vc = getViewCriteria(“MyCriteria”);
applyViewCriteria(vc);
setNamedWhereClauseParam(“some_param”, anyParam);
executeQuery();

3- Within your Managed Bean

AppModuleImpl am = new AppModuleImpl();
ViewObjectImpl vo = am.getYourViewObject();
ViewCriteria vc = getViewCriteria(“MyCriteria”);
vo.applyViewCriteria(vc);
vo.setNamedWhereClauseParam(“some_param”, anyParam);
vo.executeQuery();