You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "James Renfro (JIRA)" <ji...@apache.org> on 2007/05/05 01:34:15 UTC
[jira] Created: (WICKET-534) Add a parameter to toggle an AJAX call
between asynchronous and synchronous
Add a parameter to toggle an AJAX call between asynchronous and synchronous
---------------------------------------------------------------------------
Key: WICKET-534
URL: https://issues.apache.org/jira/browse/WICKET-534
Project: Wicket
Issue Type: Improvement
Components: wicket
Affects Versions: 1.2.6
Reporter: James Renfro
Priority: Minor
When using AJAX in certain special cases it may be helpful to make XMLHttpRequest calls with the async parameter set to 'false'. This can be accomplished by modifying the code under wicket-ajax.js -- but it would be nice to have a parameter in the Java code that set the request to synchronous for the length of that call.
<snip file="wicket-ajax.js">
Wicket.Ajax.Request.prototype = {
initialize: function(url, loadedCallback, parseResponse, randomURL, failureHandler, channel) {
this.url = url;
this.loadedCallback = loadedCallback;
this.parseResponse = parseResponse != null ? parseResponse : true;
this.randomURL = randomURL != null ? randomURL : true;
this.failureHandler = failureHandler != null ? failureHandler : function() { };
this.async = true;
this.channel = channel;
this.suppressDone = false;
this.instance = Math.random();
this.debugContent = true;
},
</snip>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (WICKET-534) Add a parameter to toggle an AJAX
call between asynchronous and synchronous
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg reassigned WICKET-534:
------------------------------------
Assignee: Matej Knopp
we can probably benefit from a generic options {} parameter after the success and handler listeners. or better yet roll the success and handler listeners into the options map.
> Add a parameter to toggle an AJAX call between asynchronous and synchronous
> ---------------------------------------------------------------------------
>
> Key: WICKET-534
> URL: https://issues.apache.org/jira/browse/WICKET-534
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.2.6
> Reporter: James Renfro
> Assigned To: Matej Knopp
> Priority: Minor
>
> When using AJAX in certain special cases it may be helpful to make XMLHttpRequest calls with the async parameter set to 'false'. This can be accomplished by modifying the code under wicket-ajax.js -- but it would be nice to have a parameter in the Java code that set the request to synchronous for the length of that call.
> <snip file="wicket-ajax.js">
> Wicket.Ajax.Request.prototype = {
> initialize: function(url, loadedCallback, parseResponse, randomURL, failureHandler, channel) {
> this.url = url;
> this.loadedCallback = loadedCallback;
> this.parseResponse = parseResponse != null ? parseResponse : true;
> this.randomURL = randomURL != null ? randomURL : true;
> this.failureHandler = failureHandler != null ? failureHandler : function() { };
> this.async = true;
> this.channel = channel;
> this.suppressDone = false;
> this.instance = Math.random();
> this.debugContent = true;
> },
> </snip>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WICKET-534) Add a parameter to toggle an AJAX
call between asynchronous and synchronous
Posted by "Matej Knopp (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matej Knopp resolved WICKET-534.
--------------------------------
Resolution: Won't Fix
Won't fix as synchronous ajax requests are pure evil :)
> Add a parameter to toggle an AJAX call between asynchronous and synchronous
> ---------------------------------------------------------------------------
>
> Key: WICKET-534
> URL: https://issues.apache.org/jira/browse/WICKET-534
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.2.6
> Reporter: James Renfro
> Assigned To: Matej Knopp
> Priority: Minor
>
> When using AJAX in certain special cases it may be helpful to make XMLHttpRequest calls with the async parameter set to 'false'. This can be accomplished by modifying the code under wicket-ajax.js -- but it would be nice to have a parameter in the Java code that set the request to synchronous for the length of that call.
> <snip file="wicket-ajax.js">
> Wicket.Ajax.Request.prototype = {
> initialize: function(url, loadedCallback, parseResponse, randomURL, failureHandler, channel) {
> this.url = url;
> this.loadedCallback = loadedCallback;
> this.parseResponse = parseResponse != null ? parseResponse : true;
> this.randomURL = randomURL != null ? randomURL : true;
> this.failureHandler = failureHandler != null ? failureHandler : function() { };
> this.async = true;
> this.channel = channel;
> this.suppressDone = false;
> this.instance = Math.random();
> this.debugContent = true;
> },
> </snip>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-534) Add a parameter to toggle an AJAX
call between asynchronous and synchronous
Posted by "Matej Knopp (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493869 ]
Matej Knopp commented on WICKET-534:
------------------------------------
I don't say this would be difficult to add but why on earth would anyone want to do that? Synchronous requests are evil and they lock the browser...
> Add a parameter to toggle an AJAX call between asynchronous and synchronous
> ---------------------------------------------------------------------------
>
> Key: WICKET-534
> URL: https://issues.apache.org/jira/browse/WICKET-534
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.2.6
> Reporter: James Renfro
> Assigned To: Matej Knopp
> Priority: Minor
>
> When using AJAX in certain special cases it may be helpful to make XMLHttpRequest calls with the async parameter set to 'false'. This can be accomplished by modifying the code under wicket-ajax.js -- but it would be nice to have a parameter in the Java code that set the request to synchronous for the length of that call.
> <snip file="wicket-ajax.js">
> Wicket.Ajax.Request.prototype = {
> initialize: function(url, loadedCallback, parseResponse, randomURL, failureHandler, channel) {
> this.url = url;
> this.loadedCallback = loadedCallback;
> this.parseResponse = parseResponse != null ? parseResponse : true;
> this.randomURL = randomURL != null ? randomURL : true;
> this.failureHandler = failureHandler != null ? failureHandler : function() { };
> this.async = true;
> this.channel = channel;
> this.suppressDone = false;
> this.instance = Math.random();
> this.debugContent = true;
> },
> </snip>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-534) Add a parameter to toggle an AJAX
call between asynchronous and synchronous
Posted by "Matej Knopp (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493886 ]
Matej Knopp commented on WICKET-534:
------------------------------------
You can always do this using Wicket.Ajax.Call directly (e.g. after construction you set myCallObject.request.async=false). But you need to build the call manually (using the url provided from behavior).
> Add a parameter to toggle an AJAX call between asynchronous and synchronous
> ---------------------------------------------------------------------------
>
> Key: WICKET-534
> URL: https://issues.apache.org/jira/browse/WICKET-534
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.2.6
> Reporter: James Renfro
> Assigned To: Matej Knopp
> Priority: Minor
>
> When using AJAX in certain special cases it may be helpful to make XMLHttpRequest calls with the async parameter set to 'false'. This can be accomplished by modifying the code under wicket-ajax.js -- but it would be nice to have a parameter in the Java code that set the request to synchronous for the length of that call.
> <snip file="wicket-ajax.js">
> Wicket.Ajax.Request.prototype = {
> initialize: function(url, loadedCallback, parseResponse, randomURL, failureHandler, channel) {
> this.url = url;
> this.loadedCallback = loadedCallback;
> this.parseResponse = parseResponse != null ? parseResponse : true;
> this.randomURL = randomURL != null ? randomURL : true;
> this.failureHandler = failureHandler != null ? failureHandler : function() { };
> this.async = true;
> this.channel = channel;
> this.suppressDone = false;
> this.instance = Math.random();
> this.debugContent = true;
> },
> </snip>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-534) Add a parameter to toggle an AJAX
call between asynchronous and synchronous
Posted by "Matej Knopp (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495280 ]
Matej Knopp commented on WICKET-534:
------------------------------------
Okay. I'm strongly against this. You can always put the javascript together by yourself.
You can do make your own
function wicketAjaxGeSync(url, successHandler, failureHandler, channel) {
var call = new Wicket.Ajax.Call(url, successHandler, failureHandler, channel);
call.request.async = false;
return call.call();
}
And use AbstractAjaxBehavior.getCallbacUrl to get the URL you need to pass to your wicketAjaxGetSync method.
> Add a parameter to toggle an AJAX call between asynchronous and synchronous
> ---------------------------------------------------------------------------
>
> Key: WICKET-534
> URL: https://issues.apache.org/jira/browse/WICKET-534
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.2.6
> Reporter: James Renfro
> Assigned To: Matej Knopp
> Priority: Minor
>
> When using AJAX in certain special cases it may be helpful to make XMLHttpRequest calls with the async parameter set to 'false'. This can be accomplished by modifying the code under wicket-ajax.js -- but it would be nice to have a parameter in the Java code that set the request to synchronous for the length of that call.
> <snip file="wicket-ajax.js">
> Wicket.Ajax.Request.prototype = {
> initialize: function(url, loadedCallback, parseResponse, randomURL, failureHandler, channel) {
> this.url = url;
> this.loadedCallback = loadedCallback;
> this.parseResponse = parseResponse != null ? parseResponse : true;
> this.randomURL = randomURL != null ? randomURL : true;
> this.failureHandler = failureHandler != null ? failureHandler : function() { };
> this.async = true;
> this.channel = channel;
> this.suppressDone = false;
> this.instance = Math.random();
> this.debugContent = true;
> },
> </snip>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-534) Add a parameter to toggle an AJAX
call between asynchronous and synchronous
Posted by "James Renfro (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12494075 ]
James Renfro commented on WICKET-534:
-------------------------------------
Matej, if you're going to close as won't fix, would you mind posting an example of how to use the Wicket.Ajax.Call directly? Or would it be reasonable to provide a method along the lines of AbstractAjaxDefaultBehavior.getCallbackScript to do this? The use case, as Igor commented, is that I'm trying to implement a particular specification (SCORM), which requires that I implement Javascript functions which block and then return a value. Using Wicket for this allows me to avoid using an applet. Thanks.
> Add a parameter to toggle an AJAX call between asynchronous and synchronous
> ---------------------------------------------------------------------------
>
> Key: WICKET-534
> URL: https://issues.apache.org/jira/browse/WICKET-534
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.2.6
> Reporter: James Renfro
> Assigned To: Matej Knopp
> Priority: Minor
>
> When using AJAX in certain special cases it may be helpful to make XMLHttpRequest calls with the async parameter set to 'false'. This can be accomplished by modifying the code under wicket-ajax.js -- but it would be nice to have a parameter in the Java code that set the request to synchronous for the length of that call.
> <snip file="wicket-ajax.js">
> Wicket.Ajax.Request.prototype = {
> initialize: function(url, loadedCallback, parseResponse, randomURL, failureHandler, channel) {
> this.url = url;
> this.loadedCallback = loadedCallback;
> this.parseResponse = parseResponse != null ? parseResponse : true;
> this.randomURL = randomURL != null ? randomURL : true;
> this.failureHandler = failureHandler != null ? failureHandler : function() { };
> this.async = true;
> this.channel = channel;
> this.suppressDone = false;
> this.instance = Math.random();
> this.debugContent = true;
> },
> </snip>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-534) Add a parameter to toggle an AJAX
call between asynchronous and synchronous
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493906 ]
Igor Vaynberg commented on WICKET-534:
--------------------------------------
yeah, but that is harder. anyways, if you think its too much a pita to build then just close this as wont fix
> Add a parameter to toggle an AJAX call between asynchronous and synchronous
> ---------------------------------------------------------------------------
>
> Key: WICKET-534
> URL: https://issues.apache.org/jira/browse/WICKET-534
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.2.6
> Reporter: James Renfro
> Assigned To: Matej Knopp
> Priority: Minor
>
> When using AJAX in certain special cases it may be helpful to make XMLHttpRequest calls with the async parameter set to 'false'. This can be accomplished by modifying the code under wicket-ajax.js -- but it would be nice to have a parameter in the Java code that set the request to synchronous for the length of that call.
> <snip file="wicket-ajax.js">
> Wicket.Ajax.Request.prototype = {
> initialize: function(url, loadedCallback, parseResponse, randomURL, failureHandler, channel) {
> this.url = url;
> this.loadedCallback = loadedCallback;
> this.parseResponse = parseResponse != null ? parseResponse : true;
> this.randomURL = randomURL != null ? randomURL : true;
> this.failureHandler = failureHandler != null ? failureHandler : function() { };
> this.async = true;
> this.channel = channel;
> this.suppressDone = false;
> this.instance = Math.random();
> this.debugContent = true;
> },
> </snip>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-534) Add a parameter to toggle an AJAX
call between asynchronous and synchronous
Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WICKET-534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493883 ]
Igor Vaynberg commented on WICKET-534:
--------------------------------------
i believe the requirement was so that the invoking function blocks. imagine you pass your js function to some library, it invokes it when it needs data. so your func has to block until the request is complete.
> Add a parameter to toggle an AJAX call between asynchronous and synchronous
> ---------------------------------------------------------------------------
>
> Key: WICKET-534
> URL: https://issues.apache.org/jira/browse/WICKET-534
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.2.6
> Reporter: James Renfro
> Assigned To: Matej Knopp
> Priority: Minor
>
> When using AJAX in certain special cases it may be helpful to make XMLHttpRequest calls with the async parameter set to 'false'. This can be accomplished by modifying the code under wicket-ajax.js -- but it would be nice to have a parameter in the Java code that set the request to synchronous for the length of that call.
> <snip file="wicket-ajax.js">
> Wicket.Ajax.Request.prototype = {
> initialize: function(url, loadedCallback, parseResponse, randomURL, failureHandler, channel) {
> this.url = url;
> this.loadedCallback = loadedCallback;
> this.parseResponse = parseResponse != null ? parseResponse : true;
> this.randomURL = randomURL != null ? randomURL : true;
> this.failureHandler = failureHandler != null ? failureHandler : function() { };
> this.async = true;
> this.channel = channel;
> this.suppressDone = false;
> this.instance = Math.random();
> this.debugContent = true;
> },
> </snip>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.