【发布时间】:2012-08-15 17:59:21
【问题描述】:
我使用 JSF 2。我需要编写一个自定义标记来更改其中消息的样式类。 所以如果我有这样的代码:
<my:errorGrid errorClass="#{richBean.erClass}" >
<my:inputField id="pid1" value="#{richBean.pid}" fsType="pid">
</my:inputField>
<h:message for="pid1" ajaxRendered="true"/>
</my:errorGrid>
错误信息应该与额外的 styleClass 一起输出。此 styleClass 的名称取自自定义标签 my:errorGrid
的属性 errorClass据我所知,我需要在模板中使用 vcp:body 标记并在 encodeChildren() 方法中处理子项。拜托,谁能给我一些提示如何实现它?也许一些建议或链接。
【问题讨论】: