You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by dhs3000 <gi...@git.apache.org> on 2015/10/17 11:32:23 UTC

[GitHub] wicket pull request: Allow the Wicket ChannelManager to be used by...

GitHub user dhs3000 opened a pull request:

    https://github.com/apache/wicket/pull/140

    Allow the Wicket ChannelManager to be used by plain Ajax requests

    Allows to replace the jQuery ajax function by one that uses Wicket’s channel manager to coordinate ajax requests in third party libraries like “select2”.
    
    Could be used for example for an autocomplete select2 component where some requests might take longer. The Wicket channel manager drops all new request (by users input) but the last request as long as one request is still processed by the server.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dhs3000/wicket master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/wicket/pull/140.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #140
    
----
commit 6e4137e67b0f6de0d0da6d7e54534c3b3ee35e71
Author: Dennis Hörsch <de...@web.de>
Date:   2015-10-09T18:03:20Z

    Allow the Wicket ChannelManager to be used by plain Ajax requests
    
    Allows to replace the jQuery ajax function by one that uses Wicket’s
    channel manager to coordinate ajax requests in third party libraries
    like “select2”.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: Allow the Wicket ChannelManager to be used by...

Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on the pull request:

    https://github.com/apache/wicket/pull/140#issuecomment-180775893
  
    @dhs3000 Please close this PR. We don't have permissions to do it ourselves.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: Allow the Wicket ChannelManager to be used by...

Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/140#discussion_r42318419
  
    --- Diff: wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js ---
    @@ -1253,6 +1253,48 @@
     		}
     	};
     
    +	Wicket.Ajax.ChanneledAjax = Wicket.Class.create();
    +
    +	Wicket.Ajax.ChanneledAjax.prototype = {
    +
    +		initialize: function(channelName, channelType, channelManager, ajaxTransport) {
    +			this.name = channelName;
    +			this.type = channelType;
    +			this.channel = this.name + "|" + this.type;
    +			this.channelManager = channelManager;
    +			this.transport = ajaxTransport? ajaxTransport : jQuery.ajax;
    +		},
    +
    +		ajax: function(url, options) {
    +			if (typeof url === "object") {
    +				options = url;
    +				url = undefined;
    --- End diff --
    
    This looks wrong. IMO if `url` is Object then:
     * if `options` is Object too then merge them
     * if `options` is undefined then: `options = url; url = options.u || options.url`
    
    There is no unit test for `url` being Object.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: Allow the Wicket ChannelManager to be used by...

Posted by martin-g <gi...@git.apache.org>.
Github user martin-g commented on the pull request:

    https://github.com/apache/wicket/pull/140#issuecomment-148988823
  
    Thanks for the contribution!
    But since Wicket itself won't use it I think it should not be part of wicket-ajax-jquery.js. It could be part of Wicket-Select2 project, for example.
    
    Let's see what other Wicket devs think about it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: Allow the Wicket ChannelManager to be used by...

Posted by dhs3000 <gi...@git.apache.org>.
Github user dhs3000 closed the pull request at:

    https://github.com/apache/wicket/pull/140


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: Allow the Wicket ChannelManager to be used by...

Posted by dhs3000 <gi...@git.apache.org>.
Github user dhs3000 commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/140#discussion_r42319138
  
    --- Diff: wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js ---
    @@ -1253,6 +1253,48 @@
     		}
     	};
     
    +	Wicket.Ajax.ChanneledAjax = Wicket.Class.create();
    +
    +	Wicket.Ajax.ChanneledAjax.prototype = {
    +
    +		initialize: function(channelName, channelType, channelManager, ajaxTransport) {
    +			this.name = channelName;
    +			this.type = channelType;
    +			this.channel = this.name + "|" + this.type;
    +			this.channelManager = channelManager;
    +			this.transport = ajaxTransport? ajaxTransport : jQuery.ajax;
    +		},
    +
    +		ajax: function(url, options) {
    +			if (typeof url === "object") {
    +				options = url;
    +				url = undefined;
    --- End diff --
    
    That sounds right. I updated the argument handling and the unit tests.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] wicket pull request: Allow the Wicket ChannelManager to be used by...

Posted by svenmeier <gi...@git.apache.org>.
Github user svenmeier commented on the pull request:

    https://github.com/apache/wicket/pull/140#issuecomment-149048094
  
    I agree with Martin here: Why have a method in Wicket, when it's not used by Wicket?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---