Login Register

dispatchEvent() to unknown leaf-node

Hi! [first post dance]

I wish to dispatch an event programmatically.
The scenario is well modelled by trying to spatially displace a regular event. E.g. a click-event occurs at (10,10) and I wish to re-dispatch (+10,+10) at (20,20).

I tried calling dispatchEvent() on the uber-container (e.g. DIV) but it seems that makes the event's target the uber-container rather than the HTML component at that location (e.g. a link, Dijit widget, etc). I tried synthesizing an entirely new event (rather than redispatching an extant one) and saw the same result.

If I call dispatchEvent() on the specific HTML component (link or wotnot), I get the expected result (e.g. the click event on the link is seen as cause for firing registered event handlers and/or page transition). My problem is that I can't actually know what leaf-node HTML element to dispatch upon -- I only know a top-level element (e.g. DIV) that contains it. I say "can't know" because I'm loading other people's pages under said node.

I'm aware IE and FF3 have 'determine element from point' methods but (a) I wish to target FF2 and (b) I suspect this won't help for the actual use-case. (which I'm happy to share if people wish but it's silly-complex and I hope this is a reasonable minimal test-case description.)

I'm aware my problem's not really Dojo-specific but hoped Dojo might hold an answer (especially since I'm already using for the site!) If you'd rather I take my question elsewhere, any chance people might suggest better forums, please?

Many thanks in advance!
Arkade.

p.s. I'll try to cut down my current 148 line test-case and attach it.