Hi,
I've got a datefield like this used on the playground at
http://demo.qooxdoo.org/devel/playground/:
> // Document is the application root
> var doc = this.getRoot();
>
> // Add button to document at fixed coordinates
> doc.add(button1,
> {
> left : 100,
> top : 50
> });
>
> doc.add(button2,
> {
> left : 100,
> top : 150
> });
>
> var date_field = new qx.ui.form.DateField();
> date_field.addListener("changeValue", function(e) {
> this.debug("ChangeValue: " + e.getData());
> }, date_field);
>
> date_field.addListener("changeSelection", function(e) {
> this.debug("ChangeSelection: " + e.getData());
> },date_field);
> var date_format = new qx.util.format.DateFormat("MMM/dd/yyyy");
> date_field.setDateFormat(date_format);
> doc.add(date_field, {left:300,top:50});
>
> // Add an event listener
> button1.addListener("execute", function(e) {
> alert("Date field value is:" + date_field.getValue() + " ...");
> });
>
> // Add an event listener
> button2.addListener("execute", function(e) {
> alert("Date field date is:" + date_field.getDate() + " ...");
> });
When I run this, I get the warning:
> 006624 There is no event handler for the event 'changeSelection' on
> target 'qx.ui.form.DateField'!Native.js (line 55)
in firebug. But the above code has that handler set. Any ideas why it's
not working?
If I select a date using the datechooser panel, then both value and date
are returned by pressing the buttons as expected. However, if I enter an
invalid date like "aug/08/2009" it gives me null for both value and
date. But "Aug/08/2009" works fine. So, do I have to enter the date in
the above format and the first letter Caps always?
Also, is returning "null" for getValue() the way to find out if the date
entered by a user is invalid? Also, getDate() gives me a deprecation
warning. So I should only use getValue() for datefields from now on?
TIA,
cheers,
skar.
--
--
The life so short, the craft so long to learn.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel