Showing posts with label ADF Query Panel. Show all posts
Showing posts with label ADF Query Panel. Show all posts

Saturday, February 9, 2013

ADF: Searching with ID while displaying Name in Query Panel

Adding attributes into query panel is simple, just adding them to the view criteria would automatically add the attributes into the query panel. This works for most types of component types i.e inputText, inputDate, chioceList, selectBooleanChoice etc. There is an additional step if you need to add a search attribute of type ListOfValues or ComboListOfValues and use corresponding ID for search.

1. Add a transient attribute into the view Object.


2. Add a view accessor and define the LOV on the  DepartmentName attribute.





3. Define a new view criteria and add the transient attribute DepartmentName and the corresponding Query attribute into the ViewCriteria.



4. Hide the DepartmentId in the query panel. Now when you search for employees using the deparmentName, search query is built using the Id attribute. (This would help the query performance by picking up index defined on the ID attribute if any.)



5. Search by Department Name.



You can download the complete example here.

Sunday, December 16, 2012

ADF Query Panel with CheckBox (Boolean search attribute)


In database the Boolean values in a column are usally stored as Y and N. This example shows how to search such columns using CheckBox.

      1.       Add a new attribute in view object. Select Mapped to Column or SQL, unselect Selected in Query, provide the alias and SQL expression DECODE(ACTIVE,’Y’,1,’N’,null).




         2.       In the attribute control hints select control type as Check Box



       3.       In query tab create view criteria to use as search panel.


       4.       From data controls, drag and drop the view criteria as ADF Query panel with table.


        5.       Run the page and use the checkbox to search for active and inactive users.


      6.       You can also provide a default value for the checkbox in viewcriteria.
    
      7.       You can download the complete example here.
Related Posts Plugin for WordPress, Blogger...