Hi,
i've added the html tag "label" and it's attribute "for" to provide selection
change of my checkbox.
<form wicket:id="selected">
<input type="checkbox" wicket:id="check" />
<label wicket:id="text"></label>
</form>
final CheckBox checkbox = checkbox();
_item.add(checkbox);
_item.add(new Label("text", text()).add(labelfor(checkbox)));
}
private CheckBox checkbox() {
final CheckBox checkbox = new CheckBox("check", choosen());
checkbox.add(new NoopAjaxFormComponentUpdatingBehavior());
return checkbox;
}
private LabelForTagModifier<String> labelfor(final CheckBox checkbox) {
return new LabelForTagModifier<String>(new
AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return checkbox.getMarkupId();
}
});
}
All works well. Now i would like to test the behavior. But if i execute the
ajax event "onclick" on the component path i get:
org.apache.wicket.WicketRuntimeException: No AjaxEventBehavior found on
component: text which matches the event: onclick
at
org.apache.wicket.util.tester.BaseWicketTester.fail(BaseWicketTester.java:1449)
at
org.apache.wicket.util.tester.BaseWicketTester.notNull(BaseWicketTester.java:1434)
at
org.apache.wicket.util.tester.BaseWicketTester.executeAjaxEvent(BaseWicketTester.java:1217)
at
org.apache.wicket.util.tester.BaseWicketTester.executeAjaxEvent(BaseWicketTester.java:1109)
...
It's clear to me that there is no ajax event behavior added to the label. But
can i test the "html event"? I would like to get this by WicketTester and not
by "external" Tester (Fitnesse, Selenium etc.).
But maybe it's impossible?
Thanks
Per
--
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]