Setting Calendar entries in OAF page


We can set a custom range of date in a calendar by using OAMessageDateFieldBean.

With the below code we can set a range of dates  minimum(actionDateText.setMinValue(dt) ) to maximum(actionDateText.setMaxValue(dt)).

OAMessageDateFieldBean actionDateText = (OAMessageDateFieldBean) webBean.findChildRecursive(“EffectiveEndDate1”);    //Getting the calender bean

The below coding is obtained from this link.

OAMessageDateFieldBean actionDateText = (OAMessageDateFieldBean) webBean.findChildRecursive(“EffectiveEndDate1”);    //Getting the calender bean

actionDateText.setValue(pageContext,null);           //setting initial val

Calendar dateCal = Calendar.getInstance();            //Getting Calendar Instance to play with

java.util.Date dt = new java.util.Date();          //Getting the date

dateCal.add(Calendar.DAY_OF_MONTH, -2);                   //Here we can set the date like -2 is two days before the  actionDateText.setMaxValue(dt) which is set… Go for a experiment and work around

dt = dateCal.getTime();                            //Getting Time

//System.out.println(“No te———-n”+dt);

//writeLog(“AK”,pageContext,”Start Date “+dt);

///actionDateText.setMinValue(dt);                 //you can set min value

actionDateText.setMaxValue(dt);                    //you can set max value Value determines the day //Here I have set the Max day that is today

//dateCal.add(Calendar.DAY_OF_MONTH,31);

//dt = dateCal.getTime();

//  writeLog(XXPO_APP_SHORT_NAME,pageContext,”End date “+dt);  //To have a log(History)

//actionDateText.setMaxValue(dt);

 

Thank you for reading

About pacesettergraam

A good and realistic person

Posted on November 29, 2013, in OAF, Oracle and tagged , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: