Home » ADF » Disable future Date on ADF “inputDate” Component
Disable future Date on ADF “inputDate” Component

Disable future Date on ADF “inputDate” Component

Sometimes we need to disable future date on ADF inputDate Component so that, a user is unable to select date after the current date.

For this purpose we can use ADF inputDate component MaxValue property. Here’s a small step by step tutorial to achieve this requirement.

Step1:- drag-drop ADF inputDate component on jspx page from component palette.

Step2:- create following method on backing bean class which return oracle.jbo.domain.Date type  currentDate.

public oracle.jbo.domain.Date getCurrentDate()
{

oracle.jbo.domain.Date cdate=new oracle.jbo.domain.Date(new java.sql.Date(new java.util.Date().getTime()));

return cdate;

}

 

Step3:- select inputDate component on jspx page and go to property inspector  MaxValue select Expression Builder select currentDate function.

 

1

Now when you’ll run the program, you be able to see that the  future date is disabled. User will be able to select the dates  before the current date.

2

 

If user manually enters the date, it’ll validate the date and will display a validation message.

3

 

Sample Code

 

About Manish Pandey

Manish Pandey is a Senior Developer with more than 3 years of experience in JAVA Programming. Currently enhancing skills in ADF.

3 comments

  1. Sorry, my bad. We can’t use groovy expression for MaxValue property of inputDate component as ADF View layer uses EL and not Groovy whereas ADFbc layer uses Groovy expression language.

  2. good post …. nice description

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>