ADF – Programatically Applying and Creating View Criteria

Apply an existing View Criteria Programmatically:

public void applyViewCriteria(ViewObjectImpl vo,HashMap criterias) 
{ ViewCriteria vc = vo.getViewCriteria("ViewCriteriaName"); vo.applyViewCriteria(vc); Iterator i = criterias.keySet().iterator(); String key=""; while (i.hasNext()) { key=i.next; vo.setNamedWhereClauseParam(key, criterias.get(key)); } vo.executeQuery(); }

Create a View Criteria Programmatically:

public void createViewCriteria(ViewObjectImpl vo, HashMap criterias)
    {
        ViewCriteria vc = vo.createViewCriteria();
        ViewCriteriaRow vcRow = vc.createViewCriteriaRow();
        Iterator i = criterias.keySet().iterator();
        String key="";
        while (i.hasNext()) {
           key=i.next;
           vcRow.setAttribute(key, criterias.get(key));
           vc.addRow(vcRow);
        }
        vo.applyViewCriteria(vc);
        vo.executeQuery();
    }

Reference Source

About Vineet Verma

Developer/Blogger/Gamer/Lazy Couch Potato...:P Need PDF Books: Knowledge Base
This entry was posted in Oracle ADF and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s