On 04/05/2012 12:08 PM, fprijate wrote:
> Hi
>
> Platform qx 1.6
>
> Static method qx.util.Serializer.toUriParameter not working (returns empty
> string);
>
> Sample:
>
> console.log(qx.util.Serializer.toUriParameter({a:1}));
>
> While
> console.log(qx.util.Serializer.toJson({a:1}));
> works as expected.
Well, the .toJson method seems to be a bit more lenient in this regard.
But the API doc for both methods state that the first argument is to be
a *qooxdoo* object, i.e. one deriving from qx.core.Object. This is not
the case with a JS object literal.
The other precondition is, as properties of that qooxdoo object are
being serialized, that those properties have string representations.
This might not be true for all qooxdoo classes, but e.g. this works:
qx.util.Serializer.toUriParameter(new qx.ui.form.DateField())
As another sample, the unit test qx.test.util.Serializer shows a custom
class that serves the same purpose. You can also pass a custom function
as an additional argument to get the properties serialized.
T.
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel