This discussion is archived
9 Replies Latest reply: Dec 28, 2012 2:26 AM by 913920 RSS

Programmatically added DateTime converter not working

913920 Newbie
Currently Being Moderated
Hello,
I'm developing with JDeveloper 11.1.2.1.0 and in my project I programmatically create a table with variour columns containing items binded to database columns. One of these items is a RichInputDate binded to a db column defined as DATE.
I need to apply a format to the output date (for example DD/MM/yyyy) and I've read I should use a converter but it doesn't work.
Here is my code:
RichInputDate resDate;
resDate = new RichInputDate();
resDate.setLabel("Date item");
resDate.setColumns(15);
resDate.setDisabled(true);

DateTimeConverter converter = (DateTimeConverter) FacesContext.getCurrentInstance().getApplication().createConverter("javax.faces.DateTime");
converter.setPattern("dd/MM/yyyy");
resDate.setConverter(converter);
I was expecting to see something like 20/12/2012 but the output I get is completely different, like 2012-12-20 17:15:48.
What's wrong? What should I do to apply a data format to my item?
Thanks in advance!!!

Roberto

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points