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 2013/05/23 16:39:40 UTC
[1/5] git commit: Non functional changes:
Updated Branches:
refs/heads/master db6827a55 -> 24cd9ef95
Non functional changes:
- fix a typo in javadoc
- diamond operator
- use Character instead of String in concatenation
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/24cd9ef9
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/24cd9ef9
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/24cd9ef9
Branch: refs/heads/master
Commit: 24cd9ef95d710beb574f0d702e7a2c87bb1a1276
Parents: 8c9fc99
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Thu May 23 17:38:13 2013 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Thu May 23 17:39:31 2013 +0300
----------------------------------------------------------------------
.../org/apache/wicket/markup/html/form/Form.java | 2 +-
.../apache/wicket/validation/ValidationError.java | 21 ++++++--------
2 files changed, 10 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/24cd9ef9/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
index a7f07f3..0b550da 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
@@ -1839,7 +1839,7 @@ public class Form<T> extends WebMarkupContainer
* containing illegal values. However, with external frameworks there may not be an alternate
* way to validate the model object. A good example of this is a JSR303 Bean Validator
* validating the model object to check any class-level constraints, in order to check such
- * constaints the model object must contain the values set by the user.
+ * constraints the model object must contain the values set by the user.
*/
protected void onValidateModelObjects()
{
http://git-wip-us.apache.org/repos/asf/wicket/blob/24cd9ef9/wicket-core/src/main/java/org/apache/wicket/validation/ValidationError.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/validation/ValidationError.java b/wicket-core/src/main/java/org/apache/wicket/validation/ValidationError.java
index c397a10..1c414e0 100644
--- a/wicket-core/src/main/java/org/apache/wicket/validation/ValidationError.java
+++ b/wicket-core/src/main/java/org/apache/wicket/validation/ValidationError.java
@@ -18,7 +18,6 @@ package org.apache.wicket.validation;
import java.io.Serializable;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -51,8 +50,6 @@ public final class ValidationError implements IValidationError
{
private static final long serialVersionUID = 1L;
- private static final Map<String, Object> EMPTY_VARS = Collections.emptyMap();
-
/** list of message keys to try against the <code>IErrorMessageSource</code> */
private List<String> keys;
@@ -139,7 +136,7 @@ public final class ValidationError implements IValidationError
if (keys == null)
{
- keys = new ArrayList<String>(1);
+ keys = new ArrayList<>(1);
}
keys.add(key);
return this;
@@ -212,7 +209,7 @@ public final class ValidationError implements IValidationError
{
if (vars == null)
{
- vars = new HashMap<String, Object>(2);
+ vars = new HashMap<>(2);
}
return vars;
}
@@ -300,7 +297,7 @@ public final class ValidationError implements IValidationError
{
if (keys == null)
{
- keys = new ArrayList<String>();
+ keys = new ArrayList<>();
}
return keys;
}
@@ -351,14 +348,14 @@ public final class ValidationError implements IValidationError
while (i.hasNext())
{
final Entry<String, Object> e = i.next();
- tostring.append("[")
+ tostring.append('[')
.append(e.getKey())
- .append("=")
+ .append('=')
.append(e.getValue())
- .append("]");
+ .append(']');
if (i.hasNext())
{
- tostring.append(",");
+ tostring.append(',');
}
}
}
@@ -366,9 +363,9 @@ public final class ValidationError implements IValidationError
{
tostring.append("null");
}
- tostring.append("]");
+ tostring.append(']');
- tostring.append("]");
+ tostring.append(']');
return tostring.toString();
}
[4/5] git commit: Remove a space character. No functional changes
Posted by mg...@apache.org.
Remove a space character. No functional changes
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/8c9fc99a
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/8c9fc99a
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/8c9fc99a
Branch: refs/heads/master
Commit: 8c9fc99a28210d2941f9c05d0810dacdc5f3e790
Parents: 2ccdc58
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Thu May 23 17:37:27 2013 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Thu May 23 17:39:31 2013 +0300
----------------------------------------------------------------------
.../src/test/java/org/apache/wicket/RedirectB.java | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/8c9fc99a/wicket-core/src/test/java/org/apache/wicket/RedirectB.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/RedirectB.java b/wicket-core/src/test/java/org/apache/wicket/RedirectB.java
index 704e620..ede169a 100644
--- a/wicket-core/src/test/java/org/apache/wicket/RedirectB.java
+++ b/wicket-core/src/test/java/org/apache/wicket/RedirectB.java
@@ -34,7 +34,7 @@ public class RedirectB extends WebPage
*/
public RedirectB()
{
- add(new Label("interceptContinuationURL", Model .of(InterceptData.get()
+ add(new Label("interceptContinuationURL", Model.of(InterceptData.get()
.getOriginalUrl()
.toString())));
[2/5] git commit: WICKET-5196 Make AjaxFormValidatingBehavior
non-static
Posted by mg...@apache.org.
WICKET-5196 Make AjaxFormValidatingBehavior non-static
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/2ccdc589
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/2ccdc589
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/2ccdc589
Branch: refs/heads/master
Commit: 2ccdc589c4ef68b6ac12e285cc9c8f4e830391c0
Parents: a6a45f2
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Thu May 23 17:36:27 2013 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Thu May 23 17:39:31 2013 +0300
----------------------------------------------------------------------
.../ajax/form/AjaxFormValidatingBehavior.java | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/2ccdc589/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormValidatingBehavior.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormValidatingBehavior.java b/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormValidatingBehavior.java
index 1afcc68..b9edc6d 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormValidatingBehavior.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormValidatingBehavior.java
@@ -167,7 +167,6 @@ public class AjaxFormValidatingBehavior extends Behavior
ThrottlingSettings throttlingSettings = new ThrottlingSettings(id,
throttleDelay);
attributes.setThrottlingSettings(throttlingSettings);
- attributes.setPreventDefault(false); // WICKET-5194
}
AjaxFormValidatingBehavior.this.updateAjaxAttributes(attributes);
[5/5] git commit: WICKET-5196 Make AjaxFormValidatingBehavior
non-static
Posted by mg...@apache.org.
WICKET-5196 Make AjaxFormValidatingBehavior non-static
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/a6a45f29
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/a6a45f29
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/a6a45f29
Branch: refs/heads/master
Commit: a6a45f29743294f2749ff0d72c22cf9f60dbb65c
Parents: 437e01d
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Thu May 23 11:25:31 2013 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Thu May 23 17:39:31 2013 +0300
----------------------------------------------------------------------
.../ajax/form/AjaxFormValidatingBehavior.java | 145 ++++++++++-----
.../src/test/java/org/apache/wicket/RedirectB.java | 2 +-
.../wicket/util/tester/MockAjaxFormPage.java | 24 ++-
.../wicket/util/tester/WicketTesterTest.java | 2 +-
.../wicket/examples/ajax/builtin/FormPage.java | 4 +-
5 files changed, 118 insertions(+), 59 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/a6a45f29/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormValidatingBehavior.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormValidatingBehavior.java b/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormValidatingBehavior.java
index 629976c..1afcc68 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormValidatingBehavior.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormValidatingBehavior.java
@@ -17,9 +17,11 @@
package org.apache.wicket.ajax.form;
import org.apache.wicket.Component;
+import org.apache.wicket.WicketRuntimeException;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
import org.apache.wicket.ajax.attributes.ThrottlingSettings;
+import org.apache.wicket.behavior.Behavior;
import org.apache.wicket.feedback.IFeedback;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.FormComponent;
@@ -37,38 +39,90 @@ import org.apache.wicket.util.visit.IVisitor;
* @author Igor Vaynberg (ivaynberg)
*
*/
-public class AjaxFormValidatingBehavior extends AjaxFormSubmitBehavior
+public class AjaxFormValidatingBehavior extends Behavior
{
private static final long serialVersionUID = 1L;
+ private final String event;
+ private final Duration throttleDelay;
+
+ /**
+ * The form that will be submitted via ajax
+ */
+ private Form<?> form;
+
+ /**
+ * A flag indicating whether this behavior has been rendered at least once
+ */
+ private boolean hasBeenRendered = false;
+
/**
* Construct.
*
- * @param form
- * form that will be submitted via ajax
* @param event
* javascript event this behavior will be invoked on, like onclick
*/
- public AjaxFormValidatingBehavior(Form<?> form, String event)
+ public AjaxFormValidatingBehavior(String event)
{
- super(form, event);
+ this(event, null);
}
/**
- *
- * @see org.apache.wicket.ajax.form.AjaxFormSubmitBehavior#onSubmit(org.apache.wicket.ajax.AjaxRequestTarget)
+ * Construct.
+ *
+ * @param event
+ * javascript event this behavior will be invoked on, like onclick
+ * @param throttleDelay
+ * the duration for which the Ajax call should be throttled
*/
+ public AjaxFormValidatingBehavior(String event, Duration throttleDelay)
+ {
+ this.event = event;
+ this.throttleDelay = throttleDelay;
+ }
+
@Override
+ public void bind(Component component)
+ {
+ super.bind(component);
+
+ if (component instanceof Form<?>)
+ {
+ form = (Form<?>) component;
+ }
+ else
+ {
+ form = Form.findForm(component);
+ if (form == null)
+ {
+ throw new WicketRuntimeException(AjaxFormValidatingBehavior.class.getSimpleName() +
+ " should be bound to a Form component or a component that is inside a form!");
+ }
+ }
+ }
+
+ @Override
+ public void onConfigure(Component component)
+ {
+ super.onConfigure(component);
+
+ if (hasBeenRendered == false)
+ {
+ hasBeenRendered = true;
+
+ form.visitChildren(FormComponent.class, new FormValidateVisitor());
+ }
+ }
+
protected void onSubmit(final AjaxRequestTarget target)
{
addFeedbackPanels(target);
}
- /**
- *
- * @see org.apache.wicket.ajax.form.AjaxFormSubmitBehavior#onError(org.apache.wicket.ajax.AjaxRequestTarget)
- */
- @Override
+ protected void onAfterSubmit(final AjaxRequestTarget target)
+ {
+ }
+
protected void onError(AjaxRequestTarget target)
{
addFeedbackPanels(target);
@@ -79,9 +133,9 @@ public class AjaxFormValidatingBehavior extends AjaxFormSubmitBehavior
*
* @param target
*/
- private void addFeedbackPanels(final AjaxRequestTarget target)
+ protected final void addFeedbackPanels(final AjaxRequestTarget target)
{
- getComponent().getPage().visitChildren(IFeedback.class, new IVisitor<Component, Void>()
+ form.getPage().visitChildren(IFeedback.class, new IVisitor<Component, Void>()
{
@Override
public void component(final Component component, final IVisit<Void> visit)
@@ -91,47 +145,16 @@ public class AjaxFormValidatingBehavior extends AjaxFormSubmitBehavior
});
}
- /**
- * Adds this behavior to all form components of the specified form
- *
- * @param form
- * @param event
- */
- public static void addToAllFormComponents(final Form<?> form, final String event)
- {
- addToAllFormComponents(form, event, null);
- }
-
- /**
- * Adds this behavior to all form components of the specified form
- *
- * @param form
- * @param event
- * @param throttleDelay
- */
- public static void addToAllFormComponents(final Form<?> form, final String event,
- final Duration throttleDelay)
+ protected void updateAjaxAttributes(final AjaxRequestAttributes attributes)
{
- form.visitChildren(FormComponent.class, new FormValidateVisitor(form, event, throttleDelay));
}
- private static class FormValidateVisitor implements IVisitor<Component, Void>, IClusterable
+ private class FormValidateVisitor implements IVisitor<FormComponent, Void>, IClusterable
{
- private final Form<?> form;
- private final String event;
- private final Duration throttleDelay;
-
- private FormValidateVisitor(Form<?> form, String event, Duration throttleDelay)
- {
- this.form = form;
- this.event = event;
- this.throttleDelay = throttleDelay;
- }
-
@Override
- public void component(final Component component, final IVisit<Void> visit)
+ public void component(final FormComponent component, final IVisit<Void> visit)
{
- final AjaxFormValidatingBehavior behavior = new AjaxFormValidatingBehavior(form, event)
+ final AjaxFormSubmitBehavior behavior = new AjaxFormSubmitBehavior(form, event)
{
@Override
protected void updateAjaxAttributes(final AjaxRequestAttributes attributes)
@@ -144,7 +167,31 @@ public class AjaxFormValidatingBehavior extends AjaxFormSubmitBehavior
ThrottlingSettings throttlingSettings = new ThrottlingSettings(id,
throttleDelay);
attributes.setThrottlingSettings(throttlingSettings);
+ attributes.setPreventDefault(false); // WICKET-5194
}
+
+ AjaxFormValidatingBehavior.this.updateAjaxAttributes(attributes);
+ }
+
+ @Override
+ protected void onSubmit(AjaxRequestTarget target)
+ {
+ super.onSubmit(target);
+ AjaxFormValidatingBehavior.this.onSubmit(target);
+ }
+
+ @Override
+ protected void onAfterSubmit(AjaxRequestTarget target)
+ {
+ super.onAfterSubmit(target);
+ AjaxFormValidatingBehavior.this.onAfterSubmit(target);
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target)
+ {
+ super.onError(target);
+ AjaxFormValidatingBehavior.this.onError(target);
}
};
component.add(behavior);
http://git-wip-us.apache.org/repos/asf/wicket/blob/a6a45f29/wicket-core/src/test/java/org/apache/wicket/RedirectB.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/RedirectB.java b/wicket-core/src/test/java/org/apache/wicket/RedirectB.java
index a990217..704e620 100644
--- a/wicket-core/src/test/java/org/apache/wicket/RedirectB.java
+++ b/wicket-core/src/test/java/org/apache/wicket/RedirectB.java
@@ -34,7 +34,7 @@ public class RedirectB extends WebPage
*/
public RedirectB()
{
- add(new Label("interceptContinuationURL", new Model<String>(InterceptData.get()
+ add(new Label("interceptContinuationURL", Model .of(InterceptData.get()
.getOriginalUrl()
.toString())));
http://git-wip-us.apache.org/repos/asf/wicket/blob/a6a45f29/wicket-core/src/test/java/org/apache/wicket/util/tester/MockAjaxFormPage.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockAjaxFormPage.java b/wicket-core/src/test/java/org/apache/wicket/util/tester/MockAjaxFormPage.java
index 5898379..eeaf101 100644
--- a/wicket-core/src/test/java/org/apache/wicket/util/tester/MockAjaxFormPage.java
+++ b/wicket-core/src/test/java/org/apache/wicket/util/tester/MockAjaxFormPage.java
@@ -69,28 +69,40 @@ public class MockAjaxFormPage extends WebPage
*/
public MockAjaxFormPage()
{
- Form<MockDomainObject> form = new Form<MockDomainObject>("form",
- new CompoundPropertyModel<MockDomainObject>(new MockDomainObject()));
+ Form<MockDomainObject> form = new Form<>("form",
+ new CompoundPropertyModel<>(new MockDomainObject()));
add(form);
final Button submit = new Button("submit");
submit.setOutputMarkupId(true);
submit.setEnabled(false);
form.add(submit);
- final TextField<String> text = new TextField<String>("text");
+ final TextField<String> text = new TextField<>("text");
+ form.add(text);
text.setRequired(true);
text.add(new StringValidator(4, null));
- text.add(new AjaxFormValidatingBehavior(form, "onkeyup")
+ text.add(new AjaxFormValidatingBehavior("keyup")
{
private static final long serialVersionUID = 1L;
@Override
- protected void onEvent(AjaxRequestTarget target)
+ protected void onSubmit(AjaxRequestTarget target)
{
+ super.onSubmit(target);
+
+ text.validate();
+ submit.setEnabled(text.isValid());
+ target.add(submit);
+ }
+
+ @Override
+ protected void onError(AjaxRequestTarget target)
+ {
+ super.onError(target);
+
text.validate();
submit.setEnabled(text.isValid());
target.add(submit);
}
});
- form.add(text);
}
}
http://git-wip-us.apache.org/repos/asf/wicket/blob/a6a45f29/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterTest.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterTest.java b/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterTest.java
index 2014c94..fb4cb38 100644
--- a/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterTest.java
+++ b/wicket-core/src/test/java/org/apache/wicket/util/tester/WicketTesterTest.java
@@ -914,7 +914,7 @@ public class WicketTesterTest extends WicketTestCase
private void setTextFieldAndAssertSubmit(boolean expected)
{
- tester.executeAjaxEvent("form:text", "onkeyup");
+ tester.executeAjaxEvent("form:text", "keyup");
Button submit = getSubmitButton();
// System.out.println(Session.get().getFeedbackMessages());
assertEquals(expected, submit.isEnabled());
http://git-wip-us.apache.org/repos/asf/wicket/blob/a6a45f29/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/FormPage.java
----------------------------------------------------------------------
diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/FormPage.java b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/FormPage.java
index 4f68189..6c85e80 100644
--- a/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/FormPage.java
+++ b/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/FormPage.java
@@ -52,7 +52,7 @@ public class FormPage extends BasePage
// add form with markup id setter so it can be updated via ajax
Bean bean = new Bean();
- Form<Bean> form = new Form<Bean>("form", new CompoundPropertyModel<Bean>(bean));
+ Form<Bean> form = new Form<>("form", new CompoundPropertyModel<>(bean));
add(form);
form.setOutputMarkupId(true);
@@ -77,7 +77,7 @@ public class FormPage extends BasePage
// attach an ajax validation behavior to all form component's keydown
// event and throttle it down to once per second
- AjaxFormValidatingBehavior.addToAllFormComponents(form, "keydown", Duration.ONE_SECOND);
+ form.add(new AjaxFormValidatingBehavior("keydown", Duration.ONE_SECOND));
// add a button that can be used to submit the form via ajax
form.add(new AjaxButton("ajax-button", form)
[3/5] git commit: Use constants
Posted by mg...@apache.org.
Use constants
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/437e01d6
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/437e01d6
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/437e01d6
Branch: refs/heads/master
Commit: 437e01d698715fc0301c85fe39da84ecb78986cb
Parents: db6827a
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Wed May 22 18:19:14 2013 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Thu May 23 17:39:31 2013 +0300
----------------------------------------------------------------------
.../wicket/util/tester/BaseWicketTester.java | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/437e01d6/wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java b/wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java
index 1fac2eb..29db03e 100644
--- a/wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java
+++ b/wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java
@@ -115,6 +115,7 @@ import org.apache.wicket.request.cycle.RequestCycle;
import org.apache.wicket.request.cycle.RequestCycleContext;
import org.apache.wicket.request.handler.render.PageRenderer;
import org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler;
+import org.apache.wicket.request.http.WebRequest;
import org.apache.wicket.request.http.WebResponse;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.request.resource.IResource;
@@ -1104,8 +1105,8 @@ public class BaseWicketTester
Charset.forName(request.getCharacterEncoding()));
transform(url);
request.setUrl(url);
- request.addHeader("Wicket-Ajax-BaseURL", url.toString());
- request.addHeader("Wicket-Ajax", "true");
+ request.addHeader(WebRequest.HEADER_AJAX_BASE_URL, url.toString());
+ request.addHeader(WebRequest.HEADER_AJAX, "true");
if (behavior instanceof AjaxFormSubmitBehavior)
{