Friday, October 8, 2010

Custom ADF Table Filter with Drop Down , Validation and case insensitive

Custom Select One Choice and Validation filter for ADF Table default filter.

Requirement: - I want have drop down in adf table column filter that does not comes out of box with filter table and also, I want validation of adf filter.

Add table filter as Drop down

1.Create simple ADF Fusion project with LocationVO and EO.



2.Create a view object call LocationLOV with following mapping for country id.



3.LocationLov will contain LocId and LocValue as two field



4.Drag and Drop ADF LocationVO as adf readonly table on new jspx file.

5.Open the designed view and go to structure window and expand column of country id




6.Insert blank select one choice in filter in column facet




7.Select table and see VarStatus object in common sub property that will be use to access binding



8.Set the select one choice value to #{vs.filterCriteria.CountryId} , this means we are going to use CountryId as filter criteria for table filter



9.Now we need to populate data in location table filter drop down , so create tree object in page bindings and add LocationLov to page definition. Remember to add location lov to application module.




















10.Now go to source of jspx and selectone choice and bind the LocationLov that we added in page definitation to this object.








11.Run the application and we will see drop down in country id filter ,select value in drop down ,however we have to press enter when filtering.




Automatically filter when drop down selected

12.Now when user select drop down and if we want to filter the table immediately then we need to press enter from java script when value change event is fired of select one choice.

13.So insert client listener in select one choice that is present in filter.



14.Also , insert resource inside jspx page







15.Create java script file and change client listener property type=”valuechange” and method to method that we will write in javascript for enter.



16.Write this java script






17.Run the page , when you select the drop down now , you will see table get filtered automatically.


Validation of table filter

18.There is one more requirement where we need to validate adf table filter e.g. when somebody enter text to search location id , we need to prompt user that please enter number.

19.So insert inputtext inside filter tab and change value to #{vs.filterCriteria.LocationId}




20.Insert validator and converted inside inputtext as follow.




21.Run the application and you will see now adf table filter is validating table filter.

To ADF table filter Case Sensitive

22.Set this property filterFeatures="caseInsensitive" in

2 comments:

  1. 1)How to send a mail using ADF?
    2)How to encrypt and decrypt password and how to store encrypted password into database??????/

    ReplyDelete