It probably comes down to determining the 'correct' listener name?
Looking in the contexts, by adding a an action to the onClick
mouse event in the designer, a new item is added to the perspective.context.component.domEvents
node called onClick
. That seems to be hard bound to whatever function is defined in the designer but there seems to be at least 1 layer of abstraction in there.
Completely misunderstood your goal here. I wouldn't be surprised at all if the entirety of the messaging system in perspective is entirely gateway side with none of the actual messaging occuring at the client level, which is where your javascript is running.