我正在尝试获取我的Wicket-Component的路径,但它总是在调用componentName.getPath()
时返回id。
实际上getPath()
的返回值与getId()
相同。
可能是什么问题以及如何获得路径?
我的目标是在另一个组合框字段中的条目更改时更新Labelfield,以便获取新值。两个字段都在同一页面上,但在不同的面板上。我试图获得该labelelement的路径,但不幸的是我总是得到这个例外:
最后一个原因:行为redb.main.modules.sample.view.details.pck.PackageCharacterizationPanel $ 9只能添加到FormComponent
的实例
我做到了:
add(new ComboBoxField<String>("name", fieldLabel("name")) {
private static final long serialVersionUID = 1L;
@Override
public IModel<List<String>> provideChoices() {
return packageNameChoices;
}
}.add(new AjaxFormComponentUpdatingBehavior("onkeyup") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(getPage().get("sample_details.logistic.package.label"));
}
}));`
答案 0 :(得分:1)
ComboBoxField
一定不能延长wicket&#39; org.apache.wicket.markup.html.form.FormComponent<T>
这就是你获得例外的原因。