在wicket的listview中添加泛型多个textField

时间:2015-07-15 13:36:37

标签: listview wicket textfield

我需要在网页中动态填充textFields并且我已经使用了listview

Form <BenificiaryFormModel> registerForm = new Form<BenificiaryFormModel>("registerForm",Model.of(new BenificiaryFormModel()));

    ListView listView = new ListView("registerListView", benificiaryRegFieldsList) {

                    @Override
                   protected void populateItem(ListItem item) {

                    LOG.debug("Increamenter value {}",incrementer);


                    BenificiaryRegFieldsBean listViewBean = (BenificiaryRegFieldsBean )item.getModelObject();

                     item.add(new Label("beneficiaryLabel", listViewBean .getLabel())); 


                        item.add(new TextField("beneficiaryTextField", new PropertyModel(benificiaryFormModel,"textFieldData."+incrementer)));//,"textFieldData."+incrementer)));
                     incrementer++;
                    }
            };

我提到了链接Retrieve values of dynamically added inputs of a form in Wicket并做了同样的事情,但我收到了警告消息,并且控件没有收到onSumit Warn消息,如下所示: 2015-07-16 12:17:50,484 [http-bio-8082-exec-9] WARN org.apache.wicket.markup.html.form.AbstractTextComponent:166 - 无法解析模型的模型类型:classname = [ org.apache.wicket.model.PropertyModel]:nestedModel = [com.sybase365.mobiliser.web.beans.BenificiaryFormModel@bde32]:[MarkupContainer [Component id = beneficiaryTextField]]的表达式= [textFieldData.0],请设置输入你自己。

会有多个文本框和标签,只有一个提交按钮来更新所有字段,所以请帮我如何获取文本字段的值onSumit

0 个答案:

没有答案