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

Igor Vaynberg commented on WICKET-3367:
---------------------------------------

looks good. a couple of comments:

allowdefault - should we rename to stop-propagation which is a more commonly 
used term?

-------------------------------

one of the biggest pains right now is being able to pass extra parameters back 
to the server - as in i want to override ajax event behavior to append some 
parameters to the callback url. i think the easiest way to do this would be to 
add a callback parameters attribute that takes a list of functions to which the 
user can add and we evaluate in order, so:

u: 'editable-label?6-1.IBehaviorListener.0-text1-label',
cbp: [], <-- thats the default - no extra params, or leave it out to make json 
shorter

if we want to pass extra parameters i can say:

getattributes().addcallbackparameterfunction("function(p) { 
p.val=Wicket.$('#foo').value }");

which outputs

cbp: [function(p) { p.val=Wicket.$('#foo').value }]

when we are building the callback url for a GET or parameter map for the POST 
we loop through these and let them build an extra map

-------------------------------

i think using JSON objects to get started is great. but, i think when we are 
done designing and we are optimizing we should use something of our own so that 
we dont include any attributes that dont have values. for example, if there is 
no indicator then the call to .do() should not have i:null, etc. this will make 
js as short as possible.

also, maybe we can add iheaderresponse.appendDoCall(attributes). this will 
allow us to further trim the js by removing multiple "Wicket.AJAX.do(" strings, 
and instead have one "Wicket.Ajax.do(" that takes a list of maps

but these are all nice to haves in the future...

                
> Rewrite all JavaScript inline event handlers to be proper attached event 
> handlers
> ---------------------------------------------------------------------------------
>
>                 Key: WICKET-3367
>                 URL: https://issues.apache.org/jira/browse/WICKET-3367
>             Project: Wicket
>          Issue Type: Sub-task
>            Reporter: Igor Vaynberg
>             Fix For: 6.0.0
>
>         Attachments: WICKET-3367.patch, WICKET-3367.patch
>
>
> Currently events added inside onclick, onsubmit attributes are problematic 
> because they cannot be cancelled by other event handlers that are attached to 
> events via javascript's addEventListener() and friends. We should extract all 
> such inlined handlers and attach them via our Wicket.Event api.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to