Wednesday, March 28, 2012

Partial Trigger programmatically

In actionlister or your bean write below code

AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
adfFacesContext.addPartialTargets();

e.g. say we have two text fields it1 and it2. Set it1 autoSubmit to true and in valuechangelister give below code

AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
System.out.println("entered");
it2.setValue(it1.getValue());
adfFacesContext.addPartialTarget(it2);

Tuesday, March 27, 2012

ViewObject Filtered Rows based on description / name /id

DCBindingContainer dcb = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding iter = dcb.findIteratorBinding("EmployeeIterator");
ViewObject view = iter.getViewObject();
Row[] rr =view.getFilteredRows("lastName", "Bill");
for(int i=0;i < rr.length ; i++) {
System.out.println(rr[i].getAttribute("empid")+" "+rr[i].getAttribute("firstName")+ " "+rr[i].getAttribute("lastName") );
}

Monday, March 26, 2012

RowSetIterator Use

RowSetIterator is used to navigate through viewobject iterator. It also have useful operations defined in it like row.previous() etc which can be used to capture previous row.

RowSetIterator rs= viewobject.createRowSetIterator(null);
while(rs.hasNext()) {
Row row = rs.next();
if(row.getAttribute("Attr_Value").toString().equalsIgnoreCase(Comparison value.toString())){
Row prRow = rs.previous();
}}

Sunday, March 25, 2012

Iterator Row changed to change the values of respecting Attributes: Automatic PPR Initiated by the ADF Binding Layer

In Oracle JDeveloper 11g, the change event policy feature can be used to refresh UI components
automatically that are bound to an ADF binding when data has changed in the model layer. To
use this feature, you set the ChangeEventPolicy property of the ADF iterator binding and the
attribute bindings to ppr, which also is the default setting.

In pagebinding select Iterator | in properties- Advanced - Change Event Policy : select value "ppr". What will happen is the moment you select a record in table other respective attributes on UI which were pointing to individual attributes from this iterator will display the new values else not.

Friday, March 2, 2012

ADF Column Date Time Format

To display the timestamp attribute values in specific pattern, add convertDateTime tag to the respective attribte and specify the pattern you want to display.