Thursday, April 8, 2010

Bit #7 - Reseting the View Criteria associated with a View Object

To reset the View Criteria defined for a specific View Object, first you will need to retrieve the View Criteria from the View Object. You do this by calling the View Object method getViewCriteria() specifying the name of the View Criteria. This method will return a ViewCriteria object. Proceed with removing the criteria from the View Object by calling removeViewCriteria() on it. Call resetCriteria() on the ViewCriteria to reset them and finally re-apply the criteria to the View Object by calling applyViewCriteria() on it. Here is an example.

Example:

        // in the context of the Application Module Implementation

        ViewObjectImpl vo = this.getSomeViewObject();

        ViewCriteria vc = vo.getViewCriteria("criteria_name");
        vo.removeViewCriteria("criteria_name");

        vc.resetCriteria();
        vo.applyViewCriteria(vc);


Context:

Application Module Implementation
View Object Implementation


2 comments:

  1. I am sorry to say, function to remove view criteria does not exist in Jdev 11.1.1.7. Which version you have worked on?

    vo.removeViewCriteria("criteria_name");

    ReplyDelete
    Replies
    1. vo is the instance of ViewObjectImpl

      Delete

Related Posts Plugin for WordPress, Blogger...