FeedbackPanel样式化/更改消息

时间:2012-01-13 14:15:23

标签: wicket

如何设计反馈信息的样式?现在它就像一个普通的html列表元素。

如何更改电子邮件验证程序等验证程序的反馈消息?

我知道我可以使用属性文件和以下代码更改.setRequired()消息:

  Required=Provide a ${label} or else...

  form.userId.Required=You have to provide a name

1 个答案:

答案 0 :(得分:1)

您需要继承FeedbackPanel(或自行重新实现)并覆盖newMessageDisplayComponent(String id, FeedbackMessage message)方法以返回您喜欢的任何组件。见JavaDoc of FeedbackPanel

对于自定义验证程序消息:在自定义验证程序中调用error时,您可以提供resourceKey,应用程序尝试通过该资源查找错误消息。如上所述:JavaDoc is your friend

相关问题