2010-11-16 35 views
0
 <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> 

當發生錯誤時,我會看到例如此:screenshotrichfaces和顯示錯誤消息

如何在「必填字段」前面顯示「說明」文本?

就像是在richfaces demo page

回答

0

我發現我在我的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 numberjavax.faces.component.UIInput.REQUIRED={0}: Required field

域標籤是在消息的前面加

0

RichFaces的演示頁上使用看看<rich:message> - 它顯示一條消息。

+0

嗨,謝謝你將考慮到。 – Guus 2010-11-16 15:42:02