Hi everyone,
I need to fire an event from code that is normally triggered by a user action. For example, a control has an onEntryChanged(oldValue, newValue, event) event attached to it, which fires whenever the user changes its value.
Now its value is changed by code as well, by altering the dataProvider, and onEntryChanged doesn't fire in that case. Which makes sense. I need to have access to the event parameter though: onEntryChanged passes it on to other functions, which in turn pass it on to other functions... et cetera. I need it to exist as well when the value is changed by code, preferably by having onEntryChanged somehow fire all the same.
Calling onEntryChanged anyway and adding code to it that for example retrieves the relevant element name in a different way rather than reading the unavailable event.getElementName() in case event equals null - and pass that as an additional parameter to all those other functions - is much work, extremely ugly and error prone. In other words: no option.
Is there a way in code to mimick a user's action of changing a control's value so that relevant events fire, or is there another way to obtain the event parameter?
Thanks in advance!
Coos