Frage

I need a general way of rendering a component specific error message right next to the component which caused it. Up to now I've used a Feedback panel, which isn't ideal if the page contains multiple components, requiring the user to scroll down the page. Also, if you place multiple Feedback panels on the page, they all display the same message. Is there a general way of rendering localised error messages near a specific component?

War es hilfreich?

Lösung

There is an Excellent Blog post on this subject from a few years back.
That details how to have error messages show up next to the component that reported the error.

http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket

Andere Tipps

You can place multiple feedback panels on a page with different sets of messages. The FeedbackPanel class has a constructor that takes an IFeedbackMessageFilter, and you can create your own implementations of this filter to limit the messages that will show.

To more completely localize your messages to appear next to the related form components, you can use a FormComponentFeedbackBorder. A good example of combining these to make a form show messages in a regular feedback panel but also highlight the bad fields is shown in this blog post.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top