I was wondering how others think the OnChange event for fields other than keyword lists should work in LotusScript.
Per Lotus support the OnChange event is by design only fired when the field is exited or when the form is refreshed. I had expected it would get fired whenever the content of a field is changed.
I’m trying to fire the onchange event from a selection in a combobox (to emulate a “jump” functionality). Since Lotus’ implementation of onChange seems the work the same way as the exiting or onblur events…what’s the point!? I was expecting it to work behave the same as that it does in a browser.
You can get the Onchange to take effect if the field is a Radio Button, check Box, Date Field (with Native OS) etc, by going to the Field Properties advanced tab and checking: Run Exiting/OnChange events after value change.
It is possible to get text fields to run a document refresh each time a keystroke takes place in the field. (but this should be used with care as it could be costly performance-wise):
Create an editable DialogList field (eg. TxtTextField)
Make sure the ‘Allow Multiple Values’ is NOT checked.
Use ‘Formula for Choices’ and make the formula the same as the field name. (eg. TxtTextField)
Un-check ‘Display Helper Button’
Check ‘Refresh fields on keyword change’ and Refresh choices on document refresh’ and ‘Allow values not in list’
You will now have a field that looks like a text field but will do a document refresh each time it changes. There are plenty of draw backs but you can now catch the field change in the QueryRecalc, PostRecalc, not to mention all the computed or CFD fields. so use with care.
INGENIOUS! I created my DialogList field and used all the settings suggested by AJP FilmIT. I didn’t even use the OnChange event - the Input Translation fires off after every keystroke, preventing the user from entering more than one character. SLICK!
I just wanted to add a note to my previous message. This is a workaround when you need an event to fire after every keystroke typed by the user… when I was done it looked just like any other editable text field (but it isn’t) -