Upcom.eu Blog

November 25, 2008

Multiple View Criterias. One Result.

Filed under: ADF, Jdeveloper 11g — Tags: , , — Stassinopoulos Dimitris @ 5:19 pm

Here is a Hint of how to take advantage of ADF and ViewCriterias.

There are cases that users demand to have more than QueryCriterias for a specific page; There is also the case to have those QueryCriterias in different tabs and disclose the desired one and have a conjunction of both in the result form or table at the same time. This functionality could be desired in many cases and sometimes could not be avoidable.

Some cases when the criteria attributes are too many to fit in one page, or if the user will want to reset some of the attributes and not all, then, you need to use two or even more PanelQuery components to produce one joined query.

In ADF this means to create more than one ViewCriterias in the viewObject.

But, I faced the problem of applying all those view criterias as a one combined query. The result was not filtering from all view criterias but the one disclosed.

At first my mind went on partial triggers, messing with iterators etc, but the solution was much quicker and more elegant.

Follow the steps described below into your application and see the results

  1. Go to your ViewObject and create the Java Implementation class

  2. Inside the class Override the executeQuery() method.

  3. Place the following code:

@Override

public void executeQuery() {

//get all view criteria names

String[] allViewCriterias=this.getAllViewCriteriaNames();

// apply them as one joined Criteria

this.setApplyJoinedViewCriteriaNames(allViewCriterias);

//now execute query.

super.executeQuery();

}

That’s it!

Now you can have as many ViewCriterias as you want and have one joined Query.

The method is called every time you press search button no matter in which Panel Query you are on and you can reset some attributes and not all.

February 1, 2008

Recover JDeveloper 11g after crash

Filed under: Jdeveloper 11g — admin @ 9:02 am

Occassionally JDeveloper fails to start after an abnormal termination. The reasons are not obvious, but this small trick will help you identify the problems behind the failure.

Instead of starting JDeveloper from the normal jdeveloper.exe or a link pointing to it, start from the same directory by using the command jdev/bin/jdev.exe, passing the same parameters as when invoking the jdeveloper.exe. You will not be able to successfully restart, but a lot of debug information will be provided to you, enabling you to identify the error. In my case, jDeveloper had a lock on one of the adfc-config.xml files; I had to rename it, as I couldn’t find where this lock was kept, start jdeveloper and then rename it back to the original name.

Powered by WordPress