2

私はテキスト入力にPrimeFacesp :editorを使い始めましたが、ほとんどの場合、それがどのように機能するかについてはかなり満足しています。ただし、ドキュメントには、ベースとなるCKEditorがThemeRollerフレームワークにプラグインされていないため、コンポーネントの寸法が自動的に調整されないことが記載されています。

したがって、たとえば:

<h:panelGrid columns="2">

    (stuff)

    <h:outputLabel value="Content:" />
    <p:editor id="editDoc" widgetVar="editorDoc"
                 value="#{editDocument.text}"
                 style="width: 700px"
                                  />

    (more stuff)
</h:panelGrid>

p:editorをh:panelGridがレンダリングするテーブルの幅に拡張したいと思います。しかし、私が試したことは何もありません。助言がありますか?

アップデート:

p:editorタグはstyle属性に注意を払わないことに注意してください。代わりに、width属性とheight属性があり、CSSパラメーターと同じようには機能しません。たとえば、width = "100%"はエラーです。

4

2 に答える 2

5

の実際の幅は、p:editorその内側のサイズによって異なります<div>。そのデフォルト値を単純に上書きできます。

<style type="text/css">
    #editDoc > div {
        width: 99.5% !important;
    }
</style>

また、のを取り外してstyle="width: 700px"、代わりにp:editor取り付けます。h:panelGrid

すべてのコンポーネントに適用されるより一般的な解決策は、クラスのデフォルト属性p:editorを上書きすることです。width.ui-editor

<style type="text/css">
    .ui-editor {
        width: 99.5% !important;
    }
</style>
于 2012-10-24T06:56:07.457 に答える
1

Primefaces 4の場合、内側の幅を設定する必要がありますiframe

<style type="text/css">
    .ui-editor iframe {
        width:100% !important;
    }
</style>
于 2014-03-20T08:18:56.877 に答える