2016-03-02 6 views
5

エラーメッセージの色を変更しようとしています。ストライプ検証を使用しています。検証に失敗した場合は、エラーメッセージを送信しています。私は赤の色でそれを望んだ。しかしそれは黒い色で示す。 Stripesフレームワークのエラーメッセージの色を変更する方法ストライプフレームワークでエラーメッセージの色を変更する方法

以下は私が試したことです。

 <div class="item"> 

      <stripes:errors /> 
      <stripes:form name="home"action="/home.action"> 
       //contents 
       </stripes:form> 
     </div> 
+0

[PDF](http://media.pragprog.com/titles/fdstr/errormessages.pdf)を参照してください。役に立つかもしれない。 –

+0

検証メッセージではなくエラーメッセージの表示方法を決定するのはユーザーIDです – Stultuske

答えて

0

エラークラスを指定するためにセレクタを使用します。これは、入力フィールドにグローバルエラースタイルを適用します。詳細については、Stripes Manualを参照してください。

1

Vinoth氏によれば、CSSクラスを適用してエラーメッセージの外観を変更することができます。それに加えて、StripesResources.propertiesを編集することで、Stripesメッセージを完全にカスタマイズすることができます。

ここでは、マークアップやCSSクラス、またはインラインスタイルを使用して、メッセージの外観を正確に定義できます。

# Resource strings used by the <stripes:errors> tag when there are no nested tags 
stripes.errors.header=<div class="my-error-wrapper"><h4>Ooops... some things went awfully awry:/h4><ol> 
stripes.errors.beforeError=<li><i class="fa fa-warning"></i>&nbsp; 
stripes.errors.afterError=</li> 
stripes.errors.footer=</ol></div> 

# Resource strings used by the <stripes:errors> tag when displaying errors for a 
# specific field (e.g. <stripes:errors field="password"/>). If not supplied the 
# values above will be used instead. 
stripes.fieldErrors.header= 
stripes.fieldErrors.beforeError=<span class="my-error-inline"><i class="fa fa-warning"></i>&nbsp; 
stripes.fieldErrors.afterError=</span> 
stripes.fieldErrors.footer= 

# Resource strings used by the stripes:messages tag 
stripes.messages.header=<div class="my-message-wrapper"><ul> 
stripes.messages.beforeMessage=<li> 
stripes.messages.afterMessage=</li> 
stripes.messages.footer=</ul></div> 

あなたはFontAwesomeアイコン(入院、これはOPのために頼むよりもさらに少し行く)などの余分な凝っを追加することができます見ることができるように。

関連する問題