List of usage examples for org.apache.wicket.ajax.attributes AjaxRequestAttributes AjaxRequestAttributes
AjaxRequestAttributes
From source file:com.aplombee.navigator.AjaxComponentScrollEventBehaviorTest.java
License:Apache License
@Test(groups = { "wicketTests" })
public void updateAjaxAttributes() {
AjaxComponentScrollEventBehavior behavior = new AjaxComponentScrollEventBehavior() {
@Override//w ww .j a va 2 s. co m
protected void onScroll(AjaxRequestTarget target) {
}
};
AjaxRequestAttributes attributes = new AjaxRequestAttributes();
behavior.updateAjaxAttributes(attributes);
boolean isAdded = false;
for (IAjaxCallListener listener : attributes.getAjaxCallListeners()) {
if (listener instanceof AjaxComponentScrollEventBehavior.ParentScrollListener) {
isAdded = true;
}
}
Assert.assertTrue(isAdded);
}
From source file:com.aplombee.navigator.AjaxPageScrollEventBehaviorTest.java
License:Apache License
@Test(groups = { "wicketTests" })
public void updateAjaxAttributes() {
AjaxPageScrollEventBehavior behavior = new AjaxPageScrollEventBehavior() {
@Override/* w ww . j a v a 2 s.com*/
protected void onScroll(AjaxRequestTarget target) {
}
};
AjaxRequestAttributes attributes = new AjaxRequestAttributes();
behavior.updateAjaxAttributes(attributes);
boolean isAdded = false;
for (IAjaxCallListener listener : attributes.getAjaxCallListeners()) {
if (listener instanceof AjaxPageScrollEventBehavior.PageScrollListener) {
isAdded = true;
}
}
Assert.assertTrue(isAdded);
}
From source file:com.comcast.cdn.traffic_control.traffic_monitor.wicket.behaviors.AbstractMultiAjaxBehavior.java
License:Apache License
/** * @return the Ajax settings for this behavior * @since 6.0// w w w.j a va2s .c om */ protected final AjaxRequestAttributes getAttributes() { final AjaxRequestAttributes attributes = new AjaxRequestAttributes(); updateAjaxAttributes(attributes); return attributes; }
From source file:sk.drunkenpanda.leaflet.behaviors.LeafletAjaxBehaviorTest.java
License:Apache License
@Test public void testStoresAttributesInAjaxRequest() { ImmutableMap<String, String> attributes = ImmutableMap.of("test1", "A", "test2", "B", "test3", "C"); TestAjaxBehavior behavior = new TestAjaxBehavior(attributes); final AjaxRequestAttributes requestAttributes = new AjaxRequestAttributes(); behavior.updateAjaxAttributes(requestAttributes); for (java.util.Map.Entry<String, String> entry : attributes.entrySet()) { Object actual = requestAttributes.getExtraParameters().get(entry.getKey()); assertThat(actual).isNotNull();// w ww . j av a 2 s . c om assertThat(actual).isEqualTo(entry.getValue()); } }