2

Richface 3.3.3 Final と JSF 1.2 を使用しています。ページで使用するリッチ要素に影響を与えないカスタム スタイル シート (WAR に含まれる予定) があります。しかし、どうにかしてリッチ スタイリングを「スキップ」する必要があります。リッチ スタイリングをオーバーライドするのは非常に苦痛です。リッチなスタイリングをオフにする「スイッチ」を知っている人はいますか?

4

4 に答える 4

2

RichFaces のドキュメントによると、以下を追加する必要があります。

<context-param>
    <param-name>org.richfaces.enableControlSkinning</param-name>
    <param-value>false</param-value>
</context-param>
<context-param>
    <param-name>org.richfaces.skin</param-name>
    <param-value>plain</param-value>
</context-param>

あなたのweb.xmlに。スキン「プレーン」にはスキン パラメータが含まれず、RichFaces コンポーネントを独自のスタイルを持つ既存のプロジェクトに埋め込むことを目的としています。

于 2013-07-11T19:08:54.377 に答える
1

普通のスキンでも、いくつかの css クラスが含まれています。私がやったことは、次のようなカスタムスキンを定義することです

<context-param>
    <param-name>org.richfaces.SKIN</param-name>
    <param-value>myskin</param-value>
</context-param>

クラスパスに空のファイルmyskin.skin.propertiesを含めます

于 2012-12-18T09:18:43.063 に答える
0

I really doubt if you can "turn off" the default Rich faces style classes. I have faced this problem and based on my experience am putting forth this solution.

If you are trying to refer your custom style sheet which is external to your WAR (I mean if its placed in a web server instead of placing it in your war file), try putting it in your xhtml page.

Also, if you are importing you custom css files from your custom folder inside your war, try putting css classes inside your xhtml page.

Below is the sample code. As I said, am answering this based on my experience after facing the same problem.

In your xhtml page,

<style type="text/css">
.rich-stglpanel-body {
     background-color: #FFFFFF;
    border: 1px solid #73C5E3;
    font-family:  Tahoma,Arial,Geneva,sans-serif;
    font-size: 11px;
    width: 877px;

}
</style>
于 2012-12-18T05:51:32.110 に答える
0

スタイリングをオフにすることはできないと思います。ただし、「プレーン」スキンを使用して、スタイリングを避けることができます。これをあなたのweb.xml

<param-name>org.richfaces.SKIN</param-name>
  <param-value>plain</param-value>
</context-param>

ただし、スキンを変更すると、すべてのページに影響します。ただし、これをすべてのページに適用したくない場合はskin、以下のように Bean プロパティに従って条件付きで設定する必要があります。

<param-name>org.richfaces.SKIN</param-name>
  <param-value>#{myBean.skinName}</param-value>
</context-param>
于 2012-12-18T06:59:37.387 に答える