Hey,
My aim is to create a dynamic form from the json. Arrays looked as a
convenient solution for grouping objects of field descriptions and values
(and some metadata) and create corresponding form widgets by traversing the
array. Do you think of another approach?
I would go with names in object because you already have the names which are in
the array anyway as key of the property. Traversing properties is no problem,
you can use getAllProperties of the property util calss [1].
A form controller is a straightforward solution. My only problem is that I
want to relate form widgets with non form widgets. For example, to place
besides a TextField a small image (or an icon), which will signal a
notification concerning that field. Or to put a table with a detail dataset.
You can still go with the form and use all the infrastructure of it. Take a
look at the add method of the form [2]. It has an options parameter which takes
additionally data you want to cary into the form renderer like that icon you
want to show or anything else.
Of course, that additional information is not read by the default renderer but
you can subclass any of the already available renderer and add the widgets you
like based on your additional information.
A second solution could be to create your own form widgets by subclassing
widget and use child controls to build up a textfield besides a icon e.g. You
just have to make sure you forward the necessary methods (see the form
interfaces) to the textfield.
We took the first solution here when we recently had the same problem.
Thank you again, qooxdoo team for your excellent work!
Your welcome. ;)
Martin
[1]
http://demo.qooxdoo.org/current/apiviewer/#qx.util.PropertyUtil~getAllProperties
[2] http://demo.qooxdoo.org/current/apiviewer/#qx.ui.form.Form~add
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel