我正在 wicket 中制作一个简单的下拉组件,如下所示:http://www.mkyong.com/wicket/wicket-select-example/
现在我得到错误:最后一个原因:没有为类定义获取方法:类 no.polaris.AdressaHomePage 表达式:2011
有人看到有什么问题吗?(它对 selectedYear 的吸气剂没有帮助)。
干杯 Terje Eithun
public class AdressaHomePage extends BasePage {
private String selectedYear = "2011";
public AdressaHomePage(final PageParameters parameters) {
add(new FeedbackPanel("feedback"));
Form<?> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
info("Selected year: " + selectedYear);
}
};
add(form);
Select<String> yearSelector = new Select<String>("year-selector", new PropertyModel<String>(this, selectedYear));
yearSelector.add(new SelectOption<String>("year1", new Model<String>("2012")));
yearSelector.add(new SelectOption<String>("year2", new Model<String>("2011")));
yearSelector.add(new SelectOption<String>("year3", new Model<String>("2010")));
yearSelector.add(new SelectOption<String>("year4", new Model<String>("2009")));
form.add(yearSelector);
}
}