Me again,
just to illustrate.. one should be able to do something like this:
anObservedExtendedDOMElement.trigger('customEventName', arg1, .... ,
argN)
each time that the event occurs in your system.
When an extended element triggers an event the (previously
registered) listeners should receive the arguments and a function
call. They should have hooked it with something like this:
anObserverExtendedDOMElement.observe(anObservedElement,
'aCustomEventName', aCustomAction)
To give us (developers) an experience of completeness using events,
aCustomAction should be able to receive the triggered arg1... argN of
the observed element
Pros: it'll allow that several interactive predefined cases to be
solved in the client side, so instantaneous responses, so better
experience of the use of the applications.
cheers,
Sebastian
PD1: it seems that all we need is to implement the #trigger function
in the extended element. What else we need?
PD2: if this is browser dependent, we can make our own event manager
only to manage the custom listening of custom events, and (another
gain) give to it an homogeneous interface, so developers can use
standard or custom events without noticing diference
On 19 jun, 10:04, Sebastian Sastre <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> I was reading some great news about prototype: it .observe and .stop
> features ease the life for event handling for all major browsers.
>
> For a feature I would like to have (beside the standard #onClick,
> #onMouseOver, etc) I need to be able to trigger custom events but I
> was unable to figure out if javascript objects can trigger generic
> events (also with custom arguments).
>
> I think this is a very powerful feature that can be implemented in
> Prototype somehow but I wonder if js already provides one in the
> existent mechanism. Anybody knows or has a reference?
>
> thank you,
>
> Sebastian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---