-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4107172
By: kkurt
I want to use datebox with time, how can i do ? Thanks..
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4108930
By: henrichen
Currently there is no "time" part for datebox. Please post to our Feature Request.
And we need a proper UI design for this time component. Any reference?
/henri
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4109158
By: taffit_
Just as reference:
The dojo toolkit has a timepicker, can be seen in action at http://dojotoolkit.org/ under See it in action -> Form Widgets -> CiviCrmDateTimePicker or Timepicker.
Other examples:
http://www.rainforestnet.com/datetimepicker.htm
As applet and also with intervalls:
http://java.arcadevillage.com/applets/timepica.htm
http://www.java2s.com/Code/JavaScript/GUI-Components/FancyTimePicker.htm
http://www.softcomplex.com/products/tigra_calendar/demo1.html
Just some inspiration ;-)
taffit
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4109499
By: henrichen
Thanks for the info.
/henri
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4122513
By: siriusjava
I believe there already is a feature request to add a time to the calendar widget.
Hi JJ,
I need to use this feature too. Where did u see we can use a datebox with time (not a Datebox and a Timebox) ? I can't find it anywhere.
I need this because i want to data bind the date and the time with the same class attribute. Or else how can i do it ?
Thanks,
Steve
Steve,
There is no Datebox with time part in ZK yet. You have to use Datebox + Timebox solution. As for "bind the date and the time with the same class attribute.", you can write TypeConverter to 'extract' only the required part so they are combined automatically.
Hi Henri,
I tried your solution, it seem a great idea, but i think it can't work.
DateTimeConverter.java
import java.util.Date; import org.zkoss.zkplus.databind.TypeConverter; import org.zkoss.zul.Timebox; public class DateTimeConverter implements TypeConverter { public Object coerceToBean(java.lang.Object val, org.zkoss.zk.ui.Component comp) { Date date = (Date) val; Date newDate = ((Timebox) comp).getValue(); //just to see the value of val and comp System.out.println("val :" + date); System.out.println("comp val :" + newDate); /* date.setHours(newDate.getHours()); date.setMinutes(newDate.getMinutes()); return date; */ return null; } public Object coerceToUi(java.lang.Object val, org.zkoss.zk.ui.Component comp) { return val; } }
Steve,
You are right. No way to get the original bean value in TypeConverter :(.
There is no direct way as what I can think then. You might need a transient variable to hold the <timebox>
value and then combine them later in onChange event listener of <timebox>.
Asked: 2007-01-17 09:46:12 +0800
Seen: 1,603 times
Last updated: Feb 13 '09