To
Create an Date Bean programmatically
OAMessageDateFieldBean
currentdate = (OAMessageDateFieldBean)createWebBean(pageContext,
OAWebBeanConstants.MESSAGE_DATE_FIELD_BEAN,
null,
"datefield");
currentdate.setReadOnly(true);
pageLayoutBean.addIndexedChild(currentdate);
To
Initialize Date
OAApplicationModule am = pageContext.getApplicationModule(webBean);--Initialize/Invoke
AM
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); -- Formatting
String
dateString = am.getOADBTransaction().getCurrentDBDate().toString();--Get
DB Date from AM
java.sql.Date sqlDate = null;
Parsing
Date Format
try {
sqlDate = new Date(f.parse(dateString).getTime());
System.out.println("What is sqlDate value ********** " + sqlDate);
}
catch (ParseException e) {
e.getMessage();
}
OAMessageDateFieldBean dateField =
(OAMessageDateFieldBean)webBean.findIndexedChildRecursive("datefield");
To
set current Date in Bean
if (dateField
!= null) {
dateField.setValue(pageContext, sqlDate);
System.out.println("I am checking dateField not null *********
" + dateField );
}
No comments:
Post a Comment