Posts

Showing posts from March, 2015

Disabling Past And Future Dates in Date Picker ADF

Image
Hi All, In this post I am going to show you how you can disable the past dates and future dates in date picker in ADF. To disable the past date for af:inputDate component we have one property "minValue". If you want to disable all the dates before current date then you can do the following. First of all write a method in your bean which will return you the current date in the format "yyyy-MM-dd" as shown below.   public Date getCurrentSystemDate() {     try {     Calendar now = Calendar.getInstance();     java.util.Date date = now.getTime();     DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");     String currentDate = formatter.format(date);     return formatter.parse(currentDate);     } catch (Exception e) {     return null;     }     }  Now bind this method to minValue property of af:inputDate component. ...

Important operation on Dates in ADF

Convert oracle.jbo.domain.Date to java.util.Date     private java.util.Date getUtilDateFromDomainDate(oracle.jbo.domain.Date selectedDate){         java.util.Date finalDate = null;         if (selectedDate != null) {         try{           java.sql.Date sqldate = selectedDate.dateValue();           finalDate = new Date(sqldate.getTime());         }catch(Exception e){             e.printStackTrace();         }         }         return finalDate;     } ======================================================================== Get month, day and year as integer value from or...

Adding Dynamic Attribute in View Object and Showing in ADF Dynamic Table

Image
Hi All, Today I am going to show you how you can create the dynamic attribute in existing view object and how you can show it in the dynamic table. In my scenario there was two attribute "FirstName" and "LastName" was static and already present in the view object. Now I need to create the two extra dynamic column  suppose "Email" and "Age" in the existing view object. First of all I have created a transient view object with two attribute "FirstName" and "LastName" as shown below: Now I have attached this view object in application module as shown below: Now open you view object and go to "Java" section and generate the VOImpl class as shown below: Also generate the ROWImpl class as shown below: Once VOImpl and VORowImpl class is generated then write the following code inside your VOImpl class. package model; import java.sql.ResultSet; import java.util.ArrayList; import java.util.List; imp...