Gennady Agranov
Gennady Agranov

Reputation: 11

sending qooxdoo form controller model through RPC call to the server

I have form controller and send its model to the server via JSON RPC - it comes there nicely but with a lot of internal fields:

"0" : "Please use 'toArray()' to see the content.", "$$hash" : "427-0", "__objectHash" : "427-0",

Is there a correct "qooxdoo" way to create JSON object from model with just user properties?

Thanks!

Upvotes: 1

Views: 83

Answers (1)

voger
voger

Reputation: 676

If you need to serialize your model to JSON you can use qx.util.Serializer.toJson(). It will convert your model to JSON containing only the model's properties. You can even pass to it your own serializer function, if you wish, to customize the serialization according to your needs.

The Demo Browser has an example on how to use qx.util.Serializer.toUriParameter() that does exactly the same thing but returns an URI parameter instead of JSON.

Upvotes: 1

Related Questions