Author: ate
Date: Wed Sep 12 15:33:52 2007
New Revision: 575109
URL: http://svn.apache.org/viewvc?rev=575109&view=rev
Log:
WICKET-649: New Wicket Portlet support: fix appending query parameters
- Fixing wicket-ajax.js Wicket.Ajax.Request.get(path) calls which have query
parameters appended to the path
See: https://issues.apache.org/jira/browse/WICKET-649#action_12526925
Modified:
wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
Modified:
wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
URL:
http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js?rev=575109&r1=575108&r2=575109&view=diff
==============================================================================
---
wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
(original)
+++
wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
Wed Sep 12 15:33:52 2007
@@ -670,6 +670,26 @@
// Executes a get request
get: function() {
+ // first check if a query string is provided
+ var qs = this.url.indexOf('?');
+ if (qs==-1) {
+ qs = this.url.indexOf('&');
+ }
+ if (qs>-1) {
+ var query = this.url.substring(qs+1);
+ // ensure the query is not empty
+ if (query && query.length > 0) {
+ // cut off query part from original url
+ this.url = this.url.substring(0,qs);
+ // ensure query ends with &
+ if (query.charAt(query.length-1)!='&') {
+ query += "&";
+ }
+ // post the query string instead to support portlets
+ // for which you cannot modify/append to the url
+ return this.post(query);
+ }
+ }
if (this.channel != null) {
var res = Wicket.channelManager.schedule(this.channel,
this.doGet.bind(this));
return res != null ? res : true;