Stop Execution Of View Object at First Load of Page

This can be done in many ways.

I am going through one simple way without creating managed bean or using task flow.

First Create the Fusion Web Application.
Then create the ADF Business Components to create Entity Object, View Object and Application Module in  Model project

Now create the page to show the table data.

Now if you run the page you will see that the VO is executed on First Page Load and it is showing data in table.

To stop that first create the ViewObjectImpl class for me it is EmployeesViewObjectImpl.java

in this class override the method

 protected void executeQueryForCollection(Object object, Object[] object2, int i)


use the below code to override.

@Override
protected void executeQueryForCollection(Object object, Object[] object2,
int i) {

if (counter > 0) {
super.executeQueryForCollection(object, object2, i);
} else {
counter = counter + 1;

}
}

 

 

Now if you run the page you will not be able to see the data. On Execute Button Click the data can be shown.
For further queries you can add comment on this blog.

 

Leave a Comment