On 6/8/10 3:15 PM, pbkofon wrote:
> Martin, 
> Your suggestion fixed the problem. I didn't know a Date object had to be
> returned in the converter. I went a step further and added the following
> target2model converter:
>
>  {converter: function(data){return dateFormat.format(data);}}
> However, while selecting a date, I get this error: too much recursion. I put
> the converter to handle proper date formatting when sending the data to the
> back-end as the server expects the date string in that format. Without it,
> everything works well. I guess the solution is to format the date manually
> before sending it off to the server. I'm fine with that.
>   
Hi Ken,

The recursion is happening because your model2target needs to look like:

function (data) {
                if (data == null || data instanceof Date) {
                  return data;
                }
                return new Date(data);
}

This one took me ages to step through and debug. :)

cheers,
Greg

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to