如何更改 tr:消息样式

发布于 2025-01-07 19:28:05 字数 1078 浏览 1 评论 0原文

我正在使用 tr:inputText reqired=”true” 为了验证空字段。

Trinidad 演示 中,我可以看到 tr :message 是红色的

我尝试使用来自 Trinidad demo 的相同皮肤,也通过 inlineStyle 但我仍然可以看到黑色的消息。

  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:tr="http://myfaces.apache.org/trinidad"
  xmlns:f="http://java.sun.com/jsf/core">
<tr:document>
    <tr:panelFormLayout>
        <tr:form>
            <tr:inputText id="it"
                          required="true">
                <f:facet name="help">
                    <tr:outputFormatted value="mail address"/>
                </f:facet>
            </tr:inputText> 
            <tr:commandButton text="submit"/>
            <tr:message for="it" inlineStyle="background-color:red; border: 1px solid #BBB1AA"/>
        </tr:form>
    </tr:panelFormLayout>
</tr:document>

也许有人知道如何更改消息样式

谢谢

I am using tr:inputText reqired=”true” In order to validate an empty field.

In the Trinidad Demo I can see that the tr:message is in red

I try to use the same skin from Trinidad demo and also via inlineStyle but I can still see the message in black.

  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:tr="http://myfaces.apache.org/trinidad"
  xmlns:f="http://java.sun.com/jsf/core">
<tr:document>
    <tr:panelFormLayout>
        <tr:form>
            <tr:inputText id="it"
                          required="true">
                <f:facet name="help">
                    <tr:outputFormatted value="mail address"/>
                </f:facet>
            </tr:inputText> 
            <tr:commandButton text="submit"/>
            <tr:message for="it" inlineStyle="background-color:red; border: 1px solid #BBB1AA"/>
        </tr:form>
    </tr:panelFormLayout>
</tr:document>

Maybe someone know how can I change the message style

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

海风掠过北极光 2025-01-14 19:28:05

将其放入您的 trinidad-skinning.css 文件中:

.AFComponentMessageCell
{
    background-color: red;
    color:blue;
}

tr:message 标签用于消息,您可以像这样放入 FacesContext

FacesContext facesContext = FacesContext.getCurrentInstance();
FacesMessage msg = new FacesMessage();
facesContext.addMessage( "id_of_component", msg );

put this in your trinidad-skinning.css file:

.AFComponentMessageCell
{
    background-color: red;
    color:blue;
}

the tr:message tag is for messages, you put into FacesContext like this

FacesContext facesContext = FacesContext.getCurrentInstance();
FacesMessage msg = new FacesMessage();
facesContext.addMessage( "id_of_component", msg );
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文