The way I do it, probably not the most elegent, but: I create a parent
form(a transparent CanvasLayout), attach that to my window....attach all
TextFields created(dynamically in my case) to the CanvasLayout. Then I
can just reference the CanvasLayout object(), iterate through its
children and get the value of <childObject>.toString() .
This value is a string in the form of "[object qx.ui.form.ComboBox]",
"[object qx.ui.form.TextField]", "[object qx.ui.window.Window]".whatever
is attached.....you get the idea.
Then do a javascript switch to handle the types of objects I am looking
for....
To reset a form, iterate through all form elements, if the object string
matches a resettable object(you should know the object types you are
looking for), set its value
HTH,
Dan
Jim Hunter wrote:
A brute force way would be to iterate each child control of the window
(assuming that you are placing your edit controls on the window itself
and not on some other control in the window) using forEachChild and
then issue a setValue('') on each child (wrap this in a try/catch
because not all qooxdoo controls have a setValue() method.
This is a brute force way but it will work. If you don't like the
ugliness of the try/catch, you can add a method to the qx Object as an
empty method (that way all controls can call the method but only ones
that you create code for will actually do something). Then in your
edit control, override the method with code to clear the value. Then
you can also write a method of Object that iterates all children and
all their children and calls this new method for clearing the value.
Then you can make one call to the window to clearValues and everything
gets cleared.
I give you this cryptic answer to get you started, you always learn
more from working out the code yourself. If you are having trouble
with the concepts or with implementing it, let me know and I'll give
you some actual code (I do this sort of thing in my app, the code not
the withholding of information :-) ).
Jim
On 11/16/06, *Aaron Cooper* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
Is there an official way to reset all fields on a qooxdoo 'form'?
I have a window for data entry, when the user clicks the 'Save' or
'Home' button, the data entry window closes, and the Home window
opens again.
If you navigate back to the data entry window, any data typed
before is still there.
Obviously the windows for this app are loaded from the start, and
are only closed when not needed. Rather than being totally
destroyed and reloaded each time.
Would using window.dispose() be a better option to get what I'm after?
And what does window.restore() do exactly?
I ask as I've tried the above method (dispose/restore) unsuccessfully.
If manually coding each feild and setting the value to blank when
the window closes is the only way then I'll do that, but I was
hoping for something more like document.getElementsByTagName or
the like as there are over 30 fields, it'd be nice just to have a
loop.
Cheers
Aaron
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to
share your
opinions on IT & business topics through brief surveys - and earn
cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
<http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV>
_______________________________________________
qooxdoo-devel mailing list
[email protected]
<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
------------------------------------------------------------------------
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
--
Help me find a cure for Cancer:
http://www.grid.org/services/teams/team.htm?id=83F99A51-C506-4F52-837D-5A0D396DC4F2
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel