0

I have custom validation added to my page, and this validation is called from business logic layer, after I click "Save" button on UI, which is AjaxSubmitLink.

On my page I have apache wicket DateTimeField, but it's validation doesn't work correctly: error message doesn't appear in FeedbackPanel, which is added on page and my custom validation is shown there correctly.

So for example I fill hours field with "321" and I will have error in console:

WARN org.apache.wicket.protocol.http.WebSession - Component-targetted feedback message was left unrendered. This could be because you are missing a FeedbackPanel on the page. Message: [FeedbackMessage message = "Translation for key [hours.RangeValidator] is not found for language [en]!", reporter = hours, level = ERROR]

Maybe someone had similar problems and have solution for this?

Thanks!

1
  • Looks like you have 2 problems. You miss a feedbackpanel and you missing a key in your resource file. Can you show some code?
    – bert
    Commented Jan 12, 2012 at 22:34

1 Answer 1

6

Because you do an Ajax-Request you have to add the feedback-panel to your AjaxRequestTarget (so it will update itself on every request).

You have to override the onError method though:

add(new AjaxSubmitLink() {
    @Override
        protected void onError(final AjaxRequestTarget target, final Form form) {
        target.addComponent(yourFeedbackPanel);
    }
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.