I have a listview inside a listview. I have a textfield inside the nested listview.
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);
}
});
I have a feedback panel on the page
add(new FeedbackPanel("feedback"));
But i don't see any errors showing up. The values are not getting submitted if I enter a value that does not pass the validation. but i don't see the error messages either.
Inside my CustomConfigValidator, I have the following
@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's javadoc: