[tip] use fields without a dataprovider attached
by Marcel Trapman
www.it2be.com
This is COOL, this is GREAT...
Didn't know this could be done but after 5 minutes of brainwashes I came up with this:
1. add a field to your form and set the dataprovider to none
2. name your field (example = 'fieldname')
3. create a method (example = 'changed_field')
4. add the following code to the method:
-----
elements.fieldname.selectAll();
application.output(elements.fieldname.getSelectedText());
-----
5. attach the method to the onFocusLost event
6. go to browse mode and test the stuff!
The only thing left is that you add your own datachanged check since this event, like onaction, won't work.
IMPORTANT: onFocusLost is potentially dangerous. I tested this but you have to build in all kinds of checks. It is better to do the check at your 'ok' or 'cancel' onAction events...
To be honest, I love my own tip :)
Cheers
BTW doesn't work on other than record-view (thanks for the correction Maarten) and not on password fields...
Comments (8)