0

Datebox and Timebox binded with the same attribute of a

asked 2009-02-10 18:27:52 +0800

bob007 gravatar image bob007
384 3 4

updated 2009-03-05 14:11:42 +0800

*** ANSWERED ***


Hi all,

How can i bind the date of a Datebox and the time of a Timebox with the same attribute of a class (ex : attribute birth of class Person)

    <datebox value="@{person.birth}" />
    <timebox value="@{person.birth}" />



I tried, it work for the display, but when i change the value of one of these input it scrap the value of the other...

Thanks,
Steve

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2009-02-10 23:57:23 +0800

madruga0315 gravatar image madruga0315 flag of Brazil
937 2 12

I believe that datebox erases time information and timebox erases date information (im not sure)

But I guess that you have implement load-when and save-when for these components, and also onChange.

something like

onDateTimeChange() {
    person.setBirth(new Date(datebox.getValue().getTime() + timebox.getValue().getTime()))
}

I didnt test this, and Im not sure if it will work, but is an idea that has some chance to work :)

Regards,
Madruga

link publish delete flag offensive edit

answered 2009-02-11 14:09:04 +0800

bob007 gravatar image bob007
384 3 4

Thanks a lot !
It sound like a great idea i will try it and tell if it work.

Steve

link publish delete flag offensive edit

answered 2009-02-12 17:51:15 +0800

bob007 gravatar image bob007
384 3 4

robertpic71 give a good solution to this problem there

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-02-10 18:27:52 +0800

Seen: 324 times

Last updated: Feb 12 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More