FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.



Mar 28, 2012, 9:32 PM
64 Posts

Re: Java bean and DateTime

  • Category: Managed Beans in NSF
  • Platform: Linux
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 4
Hello Johnny!
 
I have not yet used the datetime picker but I did have issues with dates to the back-end.  This probably will not help you, as I did get the date over as a String. 
 
(1) From my JavaBean 

private String Date_Format = "MM/dd/yyyy";

SimpleDateFormat simpledateformat = new SimpleDateFormat(Date_Format);

Calendar calendar = Calendar.getInstance();

private String ExpireDate = simpledateformat.format(calendar.getTime());

  • add getters and setters for ExpireDate
  • then get it in the back-end as such doc.appendItemValue("expireDate", ExpireDate);
     

(2) call it from your Xpage as such
 

<xp:inputText value="#{SendBulletinBean.expireDate}" id="inputText1" style="font-size:9pt" />

 
(3) in the field's properties, reflect the field as String and Not date.
 
Again, you may need the dateTime picker, perhaps this can spring some ideas.
 
L8ter!

FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.