Thursday, August 15, 2013

Multiple Choice Support in ADF BC View Criteria

It happened to see while reviewing ADF projects people are using complex implementation to allow search on multiple values. Same is available out of the box, I would like to share with you - may be it will save time during your next use case implementation.

Sample application - ADFQueryMultipleChoiceApp.zip, implements choice list LOV for Job ID attribute:


Job Id attribute is included into View Criteria as search item. Make sure to set search operator as Equals, otherwise LOV will be ignored and simple input text will be rendered:


Still in View Criteria wizard - go to UI Hints tab and make sure to select check box - Support Multiple Value Selection for JobId attribute. This will inform ADF runtime to render multi choice support in ADF query field:


This is how it looks on runtime - we can choose multiple value for Job Id - all them will be added to the query:


Data is filtered accordingly - employees with different Job Id's are included:


On SQL level - each value is added as separate bind variable:


And appended to the SQL statement WHERE clause:

9 comments:

Apostolos Kitsopoulos said...

Very nice feature. Thanks a lot Andrejus for bringing this up.

But, suppose I use a Programmatic VO with corresponding LOVs in the fields in order to filter my table instead of the VC. How can I achieve this in that case?

Regards
~apostolos

Andrejus Baranovskis said...

This sounds a different use case.

Andrejus

BradW said...

This is so cool! I keep being amazed about what you find around the corner in different tabs in ADF.... Thanks for sharing!

Andrejus Baranovskis said...

Thanks for great feedback ! :)

Ahmad Al-Zamer said...

about the comment I left earlier today about the error I get when I tried the application on jdeveloper 11.1.1.5 .
When I migrated the application to Jdeveloper 11.1.2.3 as is ,It worked without any issues.

Andrejus Baranovskis said...

It works across all version of ADF, as I know.

Andrejus

Emanuel Ismael Acosta Sanchez said...

hi andrejus greetings from México.
I have a field with a list of values ​​that is dependent to a field with multiple selection, can refine the bound field based on multiple selections?

rachelin said...

Hi,

Is there a way to set default value when using "support multiple value selection?"

Thanks.

Santhosh said...

Dear Andrejus,

I am facing a problem while using the multiple choice in the af:query based search.
I used the same application as posted by you. But added a tooltip text for the field 'JobId' which has been incorporated with the multiple choice selection.

Now if i run the page,
in search, if i point my cursor on to the 'JobId' field it will show the tooltip.

Problem Definition:
After placing the cursor onto some other field in the search, the tooltip displayed for the 'JobId' will never be disappeared.

This happens only with the field incorporated with multiple choice otherwise it works fine.

Please help me in fixing this problem.

-Santhosh