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]> 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
_______________________________________________
qooxdoo-devel mailing list
[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