English 中文(简体)
定义了 widet 选定属性模式 - - 不获取方法
原标题:wicket select propertymode- -no get method defined

我在Wicket中做了一个简单的下调部分,这里的例子如下:http://www.mkyong.com/wicket/wicket-select-example/。

now I get the error: Last cause: No get method defined for class: class no.polaris.AdressaHomePage expression: 2011

有人看到什么是错的吗?

Cheers 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);
时 时

时 时

最佳回答

新属性模式( 此“ 选定年份” )

注意引号。

问题回答

暂无回答




相关问题
How to bind a TabControl to an ObservableCollection in XAML

I have the following line of code in my code-behind class. TabControl.ItemsSource = ((MainWindowViewModel)DataContext).TabItemViewModels; I would like to move this to the XAML file. In brief, ...

Bind to ancestor of adorned element

Here is the case: <DataTemplate x:Key="ItemTemplate" DataType="local:RoutedCustomCommand"> <Button Command="{Binding}" Content="{Binding Text}" ...

LINQ to SQL as databinding source for WPF Treeview

I wonder if someone could provide a simple example of the following. (preferably in VB.Net): I have an SQL database with related tables and I am successfully using LINQ to SQL in other areas of my ...

Qt equivalent of .NET data binding?

Is there an equivalent of .NET s data binding in Qt? I want to populate some combo boxes and other widgets with QStrings that refer to specific entities in my database. However, it would be cleaner ...

WPF TreeView binding through XAML

So I have a class structure like this Store Owner Cashier List of Products Product Name Price List of Vendors Company Name Contact Name So there are 4 ...

热门标签