by
Allistar Melville >> Sun, 22 Nov 1998 10:05:55 GMT
I think a worthwhile improvement to JADE would be for it to have a "formDirty" attribute which is immediately set to true when something on a form is changed. You could then have an event based on this, (or even a mapping method) which would allow you to detect changes.
One problem with this is that not all controls on the form should
cause the form to become dirty. E.g. option buttons which are used
solely for choosing how data is displayed in a table for instance - changing the value of these option buttons shouldn't make the form
dirty.
The way we have gotten around it is to subclass ALL editable controls, and use them on the form instead. This lets us code something on the sppropriate event on the control (e.g "change" for a textbox) which
then tells the form (which is also a superclass form that all forms
are subclassed from) that it has become "dirty". This can do whatever
you like, like enabling a save button/menu item on the form. This
works very well and means that once this structure is set up, no extra coding need be done per form.
Also subclassing controls/forms like this means that a lot of common
code can be placed on the superclass to save even more time with the individual instances of the control/form.
Allistar.
------------------------------------------------------------------
Allistar Melville (BSc) Home:
allistar@ihug.co.nz \_
Software Developer Work:
allistar@focussoft.co.nz </'
Auckland, NEW ZEALAND /)
Web:
http://homepages.ihug.co.nz/~allistar/ (/`
`
"A wise man proportions his belief to the evidence." David Hume ------------------------------------------------------------------