You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2011/01/16 17:53:47 UTC

svn commit: r1059615 - /wicket/trunk/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js

Author: mgrigorov
Date: Sun Jan 16 16:53:46 2011
New Revision: 1059615

URL: http://svn.apache.org/viewvc?rev=1059615&view=rev
Log:
WICKET-3337 Url to the home page is not correct when the current base url has only one segment

Set the ajax base url to '.' when this is the home page, otherwise the header is not set at all.
Tested with FF 3.6.14pre, Google Chrome 10.x and IE 7

Modified:
    wicket/trunk/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js

Modified: wicket/trunk/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js?rev=1059615&r1=1059614&r2=1059615&view=diff
==============================================================================
--- wicket/trunk/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js (original)
+++ wicket/trunk/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js Sun Jan 16 16:53:46 2011
@@ -848,6 +848,9 @@ Wicket.Ajax.Request.prototype = {
 				t.onreadystatechange = this.stateChangeCallback.bind(this);
 				// set a special flag to allow server distinguish between ajax and non-ajax requests
 				t.setRequestHeader("Wicket-Ajax", "true");
+				if (Wicket.Ajax.baseUrl === '') {
+					Wicket.Ajax.baseUrl = '.';
+				}
 				t.setRequestHeader("Wicket-Ajax-BaseURL", Wicket.Ajax.baseUrl);
 				if (typeof(Wicket.Focus.lastFocusId) != "undefined" && Wicket.Focus.lastFocusId != "" && Wicket.Focus.lastFocusId != null)
 				    t.setRequestHeader("Wicket-FocusedElementId", Wicket.Focus.lastFocusId);