[ 
https://issues.apache.org/jira/browse/WICKET-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12486057
 ] 

Gili commented on WICKET-96:
----------------------------

I think it would be useful to have concrete use-cases to go by. For example 
some components I've seen inject this code into the HTML:

onEvent="return onFunction(event);"

Now in such a case it is impossible for onFunction() to say: "Leak this event 
through, I can't handle it". Maybe the HTML code should read:

onEvent="result = onFunction(event); if (result!=PASSTHROUGH) return result;"

then other components could add their own event-handling code after this 
component.

I think we need the following from Wicket:

1) Ability to specify the order of components that handle JS events (i.e. who 
gets to try handling the event first?)
2) Component writers are only allowed to provide the name of a single function 
to be invoked (i.e. onFunction(event)), Wicket injects all the surrounding 
pass-through-handling code, and Wicket also declares the PASSTHROUGH constant 
in some formal place like Wicket.js for function writers to return.

This is just one approach to get us started. You probably have ideas on how to 
improve upon it.

> Mechanism for extensible JS-contributing behaviors
> --------------------------------------------------
>
>                 Key: WICKET-96
>                 URL: https://issues.apache.org/jira/browse/WICKET-96
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.2.6, 1.3, 2.0
>            Reporter: Gili
>             Fix For: 1.3
>
>
> Currently if a behavior contributes javascript code which takes control of a 
> control's event (i.e. onKeyPressed) there is no way to layer another behavior 
> on top of it such that if the first behavior does not consume the keypress 
> then the next behavior can make use of it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to