我想顯示其在兩種模式中使用的文本區域:哪個JSF組件在非編輯模式下顯示文本區域?
- 的變形模式,使用對:編輯
- 的可視化模式,其中僅文本區域是可見的。
哪個組件將是這個可視化模式的最佳選擇?我曾嘗試過:
- p:editor:我不希望工具欄可見。看來它不可能隱藏它。
- p:outputTextarea:由p:editor生成的html標籤在textarea中可見
- h:outputText:渲染與p:editor有點不同,最重要的是,由於沒有垂直滾動條,文本溢出其容器。
我也嘗試用p:outputTextarea編輯和可視化模式,但我會在p:editor中使用其他工具。
有什麼想法?
<p:panel id="panelDG">
<p:dataGrid id="pdatagrid1" layout="grid" value="#{ib.bloc.groups}" var="group" columns="#{ib.bloc.groupsSize}" rowIndexVar="status">
<!-- other components -->
<p:panel styleClass="panel-textarea">
<s:account>
<p:editor id="editor1" value="#{ib.textArea1}" rendered="#{status == 0}" maxlength="4000" controls="bold italic underline strikethrough bullets outdent indent alignleft center alignright justify undo redo" />
<p:editor id="editor2" value="#{ib.textArea2}" rendered="#{status == 1}" maxlength="4000" controls="bold italic underline strikethrough bullets outdent indent alignleft center alignright justify undo redo" />
<p:editor id="editor3" value="#{ib.textArea3}" rendered="#{status == 2}" maxlength="4000" controls="bold italic underline strikethrough bullets outdent indent alignleft center alignright justify undo redo" />
<h:panelGrid >
<p:commandButton value="Save" action="#{ib.modifyGroupText(group)}" icon="ui-icon-disk" />
</h:panelGrid>
</s:account>
<s:guest>
<h:outputText value="#{group.textArea}" escape="false"></h:outputText>
</s:guest>
</p:panel>
</p:dataGrid>
</p:panel
.panel-textarea{
height: 500px;
}
*「渲染是從P的一點點不同:編輯和高於一切,因爲有沒有垂直滾動條,文本溢出它的容器「*只需扔入一些CSS來對齊它? – BalusC
你的意思是在panel-textarea類或其他類中選擇一個更大的高度值?我不想要很大的價值。此外,我希望網頁能夠做出反應。在移動屏幕上,高度應該更大。 「 – ballidanse
_」p:編輯器:我不想讓工具欄變得可見,似乎無法隱藏它。「_:你嘗試了什麼? **容易**隱藏與css – Kukeltje