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.

9 comments:

  1. How to custom this using a Button to Search data instead of filter using key words. Thanks

    ReplyDelete
    Replies
    1. You can use button also.

      in the jsff page remove the client and server listeners. Add a button and call the same action listener.

      Or

      In the catchKeyStroke javascript function un-comment the code, This will raise the event after 2 chars of data length.

      Delete
    2. This comment has been removed by the author.

      Delete
    3. If you want Go button then change this method.

      Delete
  2. One more thing is when using this case, what is different if using a Button --> Enter values then Search.
    I mean when we have milion records, this case is slow to search, rigth ?

    ReplyDelete
    Replies
    1. If you want to handle huge no of records.

      Provide the Range size for "EmployeesVOIterator" in the page bindings.

      This will get only fetch the limited records.

      Delete
  3. Hi Sundara,

    I have implemented the above solution, receiving below error, and selected value(right side list) gets cleared from the list

    <_getSelectedItems> Could not find value:0887 of type:java.lang.String among list of SelectItems

    Have you come across this error, and what causes this issue?

    Thanks,
    San.

    ReplyDelete
  4. Thanks for this blog i implemented same, but when am filtering the selected values are changing for each letter filter... can u help me on this issue.

    ReplyDelete
  5. Hi i developed same application in 11.1.1.7.0 am getting issue in filtering and same application is working perfect 12.2.1.0.0.
    i posted same question in OTN can you please help me.
    https://community.oracle.com/thread/4011712

    ReplyDelete