【发布时间】:2017-11-22 14:47:31
【问题描述】:
PrimeFaces TextEditor 有问题。
我想打印 TextEditor 中的 content,但是当我单击“打印”按钮时,我只得到 blank PDF。可能是代码有错误还是我遗漏了什么?
textEditor.xhtml:
<ui:define name="content">
<div class="ui-g">
<div class="ui-g-12">
<div class="card">
<h:form>
<h3 style="margin-top:0">Text editor</h3>
<p:textEditor widgetVar="editor1" value="#{editorView.text}" height="400" style="margin-bottom:10px"/>
<h:outputText id="text_to_print" escape="false" value="#{editorView.text}" />
<p:commandButton value="Preview" update="display" oncomplete="PF('dlg').show()" icon="ui-icon-circle-zoomin" />
<p:commandButton value="Print" type="button" icon="ui-icon-print">
<p:printer target="text_to_print" />
</p:commandButton>
<p:commandButton value="Clear" type="button" onclick="PF('editor1').clear();" icon="ui-icon-close" />
<p:dialog header="Preview" widgetVar="dlg" showEffect="fade" hideEffect="fade">
<p:outputPanel id="display">
<h:outputText value="#{editorView.text}" escape="false" />
</p:outputPanel>
</p:dialog>
</h:form>
</div>
</div>
</div>
</ui:define>
托管 bean (EditorView.java)
package org.primefaces.ultima.view.input;
import javax.faces.bean.ManagedBean;
@ManagedBean
public class EditorView {
private String text;
private String text2;
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public String getText2() {
return text2;
}
public void setText2(String text2) {
this.text2 = text2;
}
}
【问题讨论】:
标签: jsf primefaces jsf-2 glassfish