1

I deploy the showcase of primefaces under glassfish. When I open the page of Calendar. There is something wrong.

alt text

alt text --------------Following is my code, I think there is nothing wrong-------------

 <p:calendar value="#{unSubmitConsign.startDate}" 
                       selectListener="#{unSubmitConsign.handleDateSelect}" />

@ManagedBean(name = "unSubmitConsign")
@SessionScoped
public class UnSubmitManagedBean {
   public Date getStartDate() {
      return startDate;
   }

   public void setStartDate(Date startDate) {
      System.out.println("setStartDate:" + startDate);
      this.startDate = startDate;
   }

   private Date startDate;

   public void handleDateSelect(DateSelectEvent event) {
      SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy");
      Date date = event.getDate();
      String s = format.format(date);
      System.out.println("::::::"+s);
   }
}

It prints nothing........

2
  • 1
    The 2nd screenshot has several same error messages. But I can't decipher Chinese and I can't copypaste from a picture into Google Translate ... Can you translate it to English?
    – BalusC
    Nov 15, 2010 at 13:00
  • That means, "There are something wrong when convert the input String to a Date instance." I know what's wrong. If I use the property pattern="yyyy-MM-dd" for calendar, there will be right. Because if I don't assign a pattern, it will use the default pattern which maybe like this "mm-dd-yyyy".
    – Keating
    Nov 16, 2010 at 14:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.