I got a question about how to assign default value for Date type field available in Query Criteria. Developer had a requirement to initialize Date type query field with date equal to 10 days before current date. This requirement is very simple for ADF and can be implemented in 5 minutes without writing any code.
Download sample application - DateSearch.zip. This sample returns default value for HireDate attribute on page load automatically:
In order to implement this requirement, open View Criteria definition and assign Bind Variable parameter to HireDate attribute. Its very important, make sure you uncheck Ignore Null Values checkbox:
This will initialize Bind Variable with Null value, when user will try to search with empty HireDate attribute value. Otherwise you will get Missing In and Out parameters SQL error.
For getting correct default date value, you can use Groovy language for Bind Variable default value expression: