jsf h:消息位置如 rich:message
当我在表单中使用 rich:message
时,我在输入字段下方看到消息,颜色为红色并带有 X 图片。
我的问题是如何将 h:message
定位在与 rich:message
相同的位置?或者,从 rich:message 中删除 X 图片。 (我希望能够在输入字段下方看到红色文本,没有任何图片)。
提前致谢。
when I'm using rich:message
inside my form , I see the message just under the input field , colored in red and with X picture.
My question is how can I position h:message
to be in the same exact place like rich:message
? or alternately, to delete the X picture from the rich:message.
(I want to be able to see a red text just under the input field, without any picture).
Thank's In Advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用 RichFaces,它们会为您的
message
组件提供漂亮的样式。如果您不想使用它,则必须构建自己的 CSS 样式类来格式化消息组件。原始 JSF 的
组件具有属性styleClass
。您可以使用 CSS 类实现您想要的外观,并将类名称放在那里,如下所示:我的示例不会像 RichFaces 的实现那样显示得那么好。你需要自己弄清楚:P。
If you use RichFaces, they provide you with nice styling for your
message
component. If you don't want to use it, you have to build your own CSS style class to format the message component. Original JSF 's<h:message>
component has the attributestyleClass
. You can implement how you want it to look like with CSS class and put the class name there like this:My example will not display as nice as RichFaces's implementation. You need to figure it out yourself :P.
我发现 此链接准确解释了如何删除
rich:message
图标。那里没有提到,但是当引用 css 文件时,它应该在页面加载之后,所以我使用
。希望这对某人有帮助。
I found this link which explains exactly how to remove the
rich:message
icon.It is not mention there , but when refering a css file it should be after the pages loads, so i used
<h:outputStylesheet library="css" name="style.css"/>
.hope this helps someone.