【问题标题】:richfaces and displaying errormessagesRichfaces 和显示错误信息
【发布时间】:2010-11-16 12:15:55
【问题描述】:
        <h:form id="userSettingsForm">
            <rich:messages>
                <f:facet name="errorMarker">
                    <h:graphicImage value="/img/msgerror.png" />
                </f:facet>
            </rich:messages>


            <h:outputText value="Description:" />
            <h:inputText label="Description:" id="description"
                value="#{userSettingsForm.instance.description}" required="true"
                size="5">
                <f:validateLength minimum="3" />
            </h:inputText>

            <a:commandButton value="Validate" />

        </h:form>

当发生错误时,我会看到例如这个:screenshot

如何在“必填字段”前面显示文本“描述”?

就像在richfaces demo page的richfaces演示页面上使用的一样

【问题讨论】:

    标签: jsf richfaces


    【解决方案1】:

    看看&lt;rich:message&gt; - 它显示一条消息。

    【讨论】:

      【解决方案2】:

      我发现我的 messages_en.properties 文件中缺少某些内容。

      当我使用seam setup 创建一个时,生成的文件包含例如这个:

      javax.faces.converter.IntegerConverter.INTEGER=Value is not a number javax.faces.component.UIInput.REQUIRED=Required field

      当我添加时:

      javax.faces.converter.IntegerConverter.INTEGER={2}: Value is not a number 或者 javax.faces.component.UIInput.REQUIRED={0}: Required field

      字段标签添加在消息前面。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2016-07-25
        • 2013-08-20
        • 2019-02-03
        • 1970-01-01
        • 1970-01-01
        • 2011-08-06
        • 1970-01-01
        相关资源
        最近更新 更多