Friday 14 October 2011

Populate Current Date and Time in OAF

OAApplicationModule am = pageContext.getApplicationModule(webBean);
SimpleDateFormat f = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");
String dateString = am.getOADBTransaction().getCurrentDBDate().toString();

java.sql.Date sqlDate= new Date(f.parse(dateString).getTime());

OAMessageDateFieldBean dateField =(OAMessageDateFieldBean)webBean.findIndexedChildRecursive("currentDate");

dateField.setValue(pageContext,sqlDate);

No comments:

Post a Comment