Announcement Announcement Module
Collapse
No announcement yet.
how to bind calender field in the model Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to bind calender field in the model

    Hi,

    i m trying to bind date value (using calender). i am setting the field value through java script. value is set correctly, but never set in the bind model property. whereas other binded values r binded correctly.

    Thanx in advance.

    Shahzad

  • #2
    Not sure if this is what you mean, hope it helps

    Code:
    protected void initBinder(HttpServletRequest request,
    			ServletRequestDataBinder binder) throws Exception {
    	SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm");
    	dateFormat.setLenient(false);
    	binder.registerCustomEditor(Date.class,null,
    			new CustomDateEditor(dateFormat,true));
    }

    Comment

    Working...
    X