How is OnChange supposed to work?

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.

  • Dieter

Subject: How is OnChange supposed to work?

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.

Any tips to work around this one?

Subject: How is OnChange supposed to work?

I would LOVE an event that’s triggerd on every content change (keystroke) in a field!

Subject: How is OnChange supposed to work?

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):

  1. Create an editable DialogList field (eg. TxtTextField)

  2. Make sure the ‘Allow Multiple Values’ is NOT checked.

  3. Use ‘Formula for Choices’ and make the formula the same as the field name. (eg. TxtTextField)

  4. Un-check ‘Display Helper Button’

  5. 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.

Subject: RE: How is OnChange supposed to work?

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!

Thanks for the awesome tip!

Trish

Subject: RE: How is OnChange supposed to work?

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) -

http://www-10.lotus.com/ldd/nd6forum.nsf/ShowMyTopicsAllFlatweb/071b4e72729e7fb9852572ab005a3f9a?OpenDocument

Subject: Interesting!

I’m sure I can use this method here or there, despite the drawbacks …

Thanks a lot for this tip!

Subject: RE: How is OnChange supposed to work?

Thanks a lot for this tip. This is exactly what I expected the OnChange event of a Text field to do.

Subject: RE: How is OnChange supposed to work?

This is sheer genius, but I just wanted to add for this to work, you have to make sure ‘Allow values not in list’ is checked.

Awesome!