We all use bounded task flows in ADF application development and to switch between multiple task flows we use concept of dynamic region
Recently I came across a problem about dynamic region and bounded task flows, Scenario is like this
I have dropped a BTF in dynamic region and there is a link on page to open that task flow and those who have used dynamic region would be familiar with this piece of code
This post is about using af:progressIndicator to show live status of a particular task af:progressIndicator state is tracked and maintained by it's value property that supports org.apache.myfaces.trinidad.model.BoundedRangeModel
This class has two methods
publicabstractlonggetMaximum(){}
returns Maximum value for Model
publicabstractlonggetValue(){}
returns value for Model (current state)
Now to see live progress on page we have to refresh progressIndicator component periodically and this can be achieved using af:poll component , poll component delivers poll events to server periodically and we can ppr (refresh) progress indicator after a particular interval
Hello All,
in this tutorial i am going to explain that how to show current date and time on your ADF application page
Follow Steps-
Create a fusion web application and a page in it (i have used .jspx page)
Now drag an output text from component palette and drop it on page
Now select the output text and go to its property inspector then select value from Expression Builder as shown in image
Now in Expression Builder ,create a Managed Bean of type java.util.Date and assign its value to output text
Now run your page and see current date is there
Now to format Date and Time , drag and drop af:convertDateTime under output text from component palette
Select convertDateTime and go to property inspector and change its pattern and run your page
Now you have done basic configuration for Date/Time, if you want to refresh time (second and minute part) on page periodically then drop a poll component in page and create a poll listener in managed bean
Now write this simple code in your managed bean to invoke poll listener
Hello All,
A very common problem in ADF treeTable and tree is to refresh child nodes after any DML operation on tree.
to avoid this refresh problem developer can pragmatically refresh treeTable's child node.
First get the master ViewObject on that treeTable is based
if viewObject has any key attribute then filter it against a key for that you want to refresh child nodes
if viewObject doesn't have any key attribute, then filter it using any unique key to get header(master) row
get the rowset of child rows for that key, using viewlink accessor
and execute query for Child Rows rowset
see the refreshed child node :-)
Code- Using Key Attribute
// Get Master ViewObject
ViewObjectImpl viewObj = masterViewObject;// Filter It Using Key Attribute
Row[] grpRow = vo.findByKey(new Key(new Object[]{ keyAttribute Value }),1);// Get Child Rows using ViewLink Accessorif(grpRow.length>0){
RowSet childRows =(RowSet)grpRow[0].getAttribute("viewLink AccessorName");//Execute Child Rowset
childRows.executeQuery();}
Using Unique Key
// Get Master ViewObject
ViewObjectImpl viewObj = masterViewObject;// Filter It Using Key Attribute
Row[] grpRow=viewObj.getFilteredRows("uniqueKey", uniqueKey Value);// Get Child Rows using ViewLink Accessorif(grpRow.length>0){
RowSet childRows =(RowSet)grpRow[0].getAttribute("viewLink AccessorName");//Execute Child Rowset
childRows.executeQuery();}
Some times we edit a table in form and Save(Commit & Execute) or Cancel(Rollback & Execute) and table refreshed to its first record means focus is now on first row of table.
And we need the same row again, then we search it and perform another operation, this is really disgusting behavior of table for Developer.
To set on previously selected row after execute we can use this code,
in this scenario we have to get current row key from its IteratorBinding and after Execute we can set it again to show that row as selected.
/** * Generic Method to call operation binding **/public BindingContainer getBindings(){return BindingContext.getCurrent().getCurrentBindingsEntry();}
BindingContainer bindings = getBindings();//Get Iterator of table
DCIteratorBinding parentIter =(DCIteratorBinding)bindings.get("IteratorName");//Get current row key
Key parentKey = parentIter.getCurrentRow().getKey();//You can add your operation code here, i have used simple Cancel operation
//with Rollback and Execute
OperationBinding ob= bindings.getOperationBinding("Rollback");
ob.execute();
OperationBinding ob1= bindings.getOperationBinding("Execute");
ob1.execute();//Set again row key as current row
parentIter.setCurrentRowWithKey(parentKey.toStringFormat(true));