Dispatch mouse event to template instance

Hello,
I’m trying to dispatch a mouseClicked event to the template instance, this is the code:

from java.awt.event import MouseEvent
evt = MouseEvent(
		 event.source.parent
		,event.getID()
		,event.getWhen()
		,event.getModifiers()
		,event.x
		,event.y
		,event.clickCount
		,event.popupTrigger
		,event.button)
event.source.parent.dispatchEvent(evt)	

In my template there is only one component, this code is defined in mouseClicked event of the component and in mouseClicked event of the template.
The code is working correctly when I toggle the designer preview mode, but not from the client runtime.

Any suggestion?

Platform: Ignition 8.1, Vision.

1 Like