2 Replies Latest reply on Aug 10, 2007 10:46 AM by Daniel_Snowden

    Model to plain text

    cantspell
      Hi,

      I'm learning about these data binding in Flex so I created a model in my Flex mxml page, something like this:

      <mx:Model id="newRestaurant">
      <restaurant>
      <name>{myForm.name}</name>
      </restaurant>
      </mx:Model>

      This works fine to store and retrieve data from but I would like to print this model as text. You know, for debugging or writing to a file or so. All I tried failed (newRestaurant.toString(), newRestaurant.dataProvider,...) they all return objects and I would just like a plain structure.

      The way I do it now is rebuilding the complete model as a string with newRestaurant.restaurant.name kind of variables in it which is plain stupid. There should be a really simple way of doing this, isn't it?

      Thanks for the help!