[
https://issues.apache.org/jira/browse/WICKET-3367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13155850#comment-13155850
]
Martin Grigorov edited comment on WICKET-3367 at 11/23/11 1:56 PM:
-------------------------------------------------------------------
A patch with AjaxAttributes.
This is the current state. It is not yet finished!
The idea is:
- AjaxEventBehavior produces something like: Wicket.Ajax.do(attrs), where attrs
is a JSON object like:
{
u: 'editable-label?6-1.IBehaviorListener.0-text1-label', // url
m: 'POST', // method name. Default: 'GET'
c: 'label7', // component id (String) or window for page
e: 'click', // event name
sh: [], // list of success handlers
fh: [], // list of failure handlers
pre: [], // list of preconditions. If empty set default
: Wicket.$(settings{c}) !== null
ep: {}, // extra parameters
async: true|false, // asynchronous XHR or not
ch: 'someName|d', // AjaxChannel
i: 'indicatorId', // indicator component id
ad: true, // allow default
}
All old Ajax-related methods like #getChannel(), #getPrecondition(),
#getSuccessScript(), #getFailureScript(), ... now donate to the AjaxAttributes
and are marked as deprecated. Still around for backward compatibility.
See LinksPage example to see how the old methods should be in 6.0.
Most of the wicket-examples work.
AjaxFallback*** are broken at the moment.
Pooling of XMLHttpRequest objects is not preserved because I didn't find the
reason we do this in the old code.
www.json.org/java classes are used to generate the JSON but we can remove them
if needed. Our needs are really simple.
TODO:
- fix all wicket-examples
- use channels
- the old decorateScript(Component, CharSeq) is now just BeforeHandler, i.e.
there is no way to add script at the end of the original.
decorateSuccess/Failure can be used to execute something after the Ajax call.
Do we need handler that is executed immediately after the start of the Ajax
call?
- regenerate the unit tests' expectations
- remove the old Ajax code in wicket-ajax.js
was (Author: mgrigorov):
A patch with AjaxAttributes.
This is the current state. It is not yet finished!
The idea is:
- AjaxEventBehavior produces something like: Wicket.Ajax.do(attrs), where attrs
is a JSON object like:
{
u: 'editable-label?6-1.IBehaviorListener.0-text1-label', // url
m: 'POST', // method name. Default: 'GET'
c: 'label7', // component id (String) or window for page
e: 'click', // event name
sh: [], // list of success handlers
fh: [], // list of failure handlers
pre: [], // list of preconditions. If empty set default
: Wicket.$(settings{c}) !== null
ep: {}, // extra parameters
async: true|false, // asynchronous XHR or not
ch: 'someName|d', // AjaxChannel
i: 'indicatorId', // indicator component id
ad: true, // allow default
}
All old Ajax-related methods like #getChannel(), #getPrecondition(),
#getSuccessScript(), #getFailureScript(), ... now donate to the AjaxAttributes
and are marked as deprecated. Still around for backward compatibility.
See LinksPage example to see how the old methods should be in 6.0.
Most of the wicket-examples work.
AjaxFallback*** are broken at the moment.
Pooling of XMLHttpRequest objects is not preserved because I didn't find the
reason we do this in the old code.
www.json.org/java classes are used to generate the JSON but we can remove them
if needed. Our needs are really simple.
TODO:
- fix all wicket-examples
- the old decorateScript(Component, CharSeq) is now just BeforeHandler, i.e.
there is no way to add script at the end of the original.
decorateSuccess/Failure can be used to execute something after the Ajax call.
Do we need handler that is executed immediately after the start of the Ajax
call?
- regenerate the unit tests' expectations
- remove the old Ajax code in wicket-ajax.js
> 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