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:
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:
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:
Very nice feature. Thanks a lot Andrejus for bringing this up.
ReplyDeleteBut, 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
This sounds a different use case.
ReplyDeleteAndrejus
This is so cool! I keep being amazed about what you find around the corner in different tabs in ADF.... Thanks for sharing!
ReplyDeleteThanks for great feedback ! :)
ReplyDeleteabout the comment I left earlier today about the error I get when I tried the application on jdeveloper 11.1.1.5 .
ReplyDeleteWhen I migrated the application to Jdeveloper 11.1.2.3 as is ,It worked without any issues.
It works across all version of ADF, as I know.
ReplyDeleteAndrejus
hi andrejus greetings from México.
ReplyDeleteI 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?
Hi,
ReplyDeleteIs there a way to set default value when using "support multiple value selection?"
Thanks.
Dear Andrejus,
ReplyDeleteI 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
Andrejus,
ReplyDeleteIt's a very good article. I have a question. Is there a way we can default a value for the select many choice component even before the page loads so we have a value selected in the page once it is loaded?
Thanks,
Mahesh
Thank you!
ReplyDeleteWhere can I download it? The link is broken.
ReplyDeleteThank you.
ReplyDeleteYou can download all old samples from here - https://code.google.com/archive/p/jdevsamples/downloads
Hi Andrejus,
ReplyDeleteI have a requirement as follows.
In the header portion a search criteria is displayed with 5 attributes and below table will be result based on the above search parameters.
Now I have added two new attributes to this view criteria in the VO and now total 7 attributes are part of the View Criteria. On the run time we have to check the flag and if flag = true then we hav to include above two new attributes in to the View Criteria , otherwise no.
Please let me know how we can handle such situation.
thanks in advance
Hi Hurdaya Aalapana,
ReplyDeletei have the same requirement , do you find a solution ?