Hi Andrew, With regards to showing error messages “globally” for the form: you can just call Form.error(“message”) for that. If you then use a feedback panel with a ComponentFeedbackMessageFilter scoped to the form, it will work as expected.
For validating multiple fields at once, e.g. double entry of password, have a look at IFormValidator; You add it to the form and provide references to all components being validated. You can then choose yourself if you wish to report any errors on one of the components directly, or on the form. Met vriendelijke groet, Kind regards, Bas Gooren Op 6 apr 2025, 18:52:02 schreef andrew goh <gohand...@yahoo.com.invalid>: > I'm using Apache Wicket 9. I'm looking at field validations and feedback > messages and I'm wondering how to do this properly: > > I've got a form of the nature > > <input type="password" wicket:id="field1" label="password"/> > <span wicket:id="feedback">field feedback will be here</span> > > <input type="password" wicket:id="field2" label="confirm password"/> > <span wicket:id="feedback">field feedback will be here</span> > > <hr> > > <span wicket:id="feedback">global feedback will be here</span> > > --- > > ComponentFeedbackMessageFilter: > > > https://nightlies.apache.org/wicket/guide/9.x/single.html#_displaying_feedback_messages_and_filtering_them > > works well for the field feedbacks. > > But that supposing that I'm checking that password and confirm password > should match, and if they don't I post an error message in the 'global > feedback' feedback that is for the form. > > What would be a good way to do that? As it seemed > ContainerFeedbackMessageFilter would simply include messages from all > the child fields. > I need to flag a ValidationError or FeedbackMessage as 'global' and pass > that such that I can perhaps construct a custom FeedbackMessageFilter to > look for 'global' error messages, e.g. to say that password and confirm > password do not match. > > But it'd seem FeedbackMessage passed in public interface > IFeedbackMessageFilter > > boolean accept(FeedbackMessage message); > > And FeedbackMessage neither contains a link to the original > ValidationError() nor can a custom FeedbackMessage be passed sub-classed > say in ValidationError.setMessage(String message). e.g. that setMessage > uses a custom sub-classed FeedbackMessage instead of a string. > > Thanks in advance > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >