检票口验证列表视图中的文本字段看不到错误消息



我在listview中有一个listview。我在嵌套的listview中有一个textfield。

new ListView<ConfigStructure>("subListView", propertyList) {
                @Override
                protected void populateItem(ListItem<ConfigStructure> item) {
                    ConfigStructure config = item.getModelObject();
                    final TextField<String> configValue = new TextField<>("configValue",new PropertyModel(config, "value"));
                    configValue.setRequired(true);
                    configValue.add(new CustomConfigValidator(config));
                    item.add(configValue);
                }
            });

我在页面上有一个反馈面板

add(new FeedbackPanel("feedback"));

但是我没有看到任何错误显示。如果我输入的值没有通过验证,则不会提交值。但是我也没有看到错误信息。

在我的CustomConfigValidator中,我有以下

@Override
public void validate(IValidatable<String> validatable) {
    //get input from attached component
    final String field = validatable.getValue();
    if(!checkIfValid){
        error(validatable, "Validation failed for " + config.getLabel() + " with value " + field + ",value should satisfy " + validateString);
    }

Reader ListView的javadoc:

<strong>WARNING:</strong> though you can nest ListViews within Forms, you HAVE to set the setReuseItems property to true in order to have validation work properly. By default, ...

最新更新