Sunday, July 7, 2013

Bug in View Criteria - Joining Multiple Criteria Item Groups Doesn't Work

If you plan to use declarative ADF BC View Criteria features, you should keep in mind one bug related to complex View Criteria implementation with multiple joined criteria items. It doesn't work to define two or more top level criteria with AND/OR conditions. This is reproduced across all ADF versions.

Wizard allows to create two or more criteria groups:


However, when you run the page - ADF Query renders search item only from the second criteria group:


If you go to the source code of VO, XML contains indeed only one criteria group, this is why only one was rendered on UI:


Switch to wizard mode and open the same View Criteria again - it still shows two criteria groups defined:


It looks like JDeveloper is caching criteria definition in memory, but really wizard is not able to construct proper XML and it is loosing one of the criteria groups.

Try to close and open same VO, open View Criteria wizard again - after closing/opening VO it will display only one criteria group (second group is lost):


We can try to add new criteria group manually into VO XML:


Wizard displays it correctly:


Runtime still fails with class cast exception:


Download sample application for test case - CustomCriteriaOperatorApp_v2.zip.

2 comments:

BradW said...

I've seen this as well. There is not much you can do. One of the challenges of packaged components. :)

Andrejus Baranovskis said...

Yes... :) I have posted kind of workaround here: http://andrejusb.blogspot.com/2013/07/joining-static-where-clause-and-view.html

Andrejus