Pages

Wednesday, February 26, 2014

How to Filter ADF Select Many Shuttle Component

In this post i am going to explain how to filter a shuttle component. We can implement this technique to filter other components.

The selectManyShuttle provides a mechanism for selecting multiple values from a list of values by allowing the user to move items between two lists. But if your selection list is big then it is difficult to find out the values. So in this blog i will explain how to filter the shuttle.


I create a sample modal package based on the Hr - Employee table.


Wrote a simple application module method to filter the employees.


Created a simple page page, then go to bindings and create a list binding four your employee view object.

Go to bindings -> Click on the Add button under bindings section and select the "List" binding.


Then select list binding type to "Standalone select multiple value list".


Then select the Base data source, Base attribute and Display attribute.


Then go to the design view and drop the shuttle component from the components pallet. Then provide the Binding which you created just now #{bindings.<Your List Name>.items}.


Then created a input text box to get the search string and provided a client listener and server listener to handle the key up listener.


Note: All these shuttle or any Multi select components will maintain different index. To clear this index we need to reset the selection list.

All the selected values are passed to the query in the IN clause before filter.

Screen shots.



You can download the sample code.