Wicket Bug
I’ll have to file a bug report for this, since it is so interesting, though more investigation is required to see how pervasive it is.
Generally, when I use Wicket, I don’t use a FeedbackPanel to display error messages to the user. Instead, I use a FormComponent.IVisitor that walks through all the FormComponents for the form that was submitted (via AJAX, natch). Each component is check to see if it is failed, enabled, and required, and then pulls the error message from the component.
That message is then fed back to the browser via the AjaxRequestTarget as a call to a JavaScript method that’ll pop up an error, or whatever special sauce I require. Usually I pass back the ID of the failed element and the message, and then use jQuery to build some sort of error bubble.
While implementing the above, I ran into an interesting bug - this part gets a bit technical, so I forgive you if you click away. I have a Wizard that renders a form containing DynamicWizardStep. The DWS then has a RadioGroup with a DropDownChoice embedded within it.
Here’s the bug: if I hit the “next” button on my wizard, both (required) components fail. That’s expected - the unexpected part is that the RadioGroup error message is… null! If I move the DropDownChoice outside of the RadioGroup, both work properly again.
Now, it isn’t great design to nest one within the other (I did fix that part), but the lack of validation message is just weird. It does fire the validation, just loses the error.
I wonder if I can make a quickstart for that…