2
PrimeFaces TextEditor에 문제가 있습니다.PrimeFaces의 내용을 인쇄 할 수 없습니다. TexEditor
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>
관리 빈 (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;
}
}
여전히 동일합니다. 나는 질문을 업데이트했다. –
EditorBean도 표시 할 수 있습니까? EditorBean에서 속성 텍스트를 인쇄한다는 의미입니다. 당신이 그것을 EditorView – pwain
에 다시 설정했기 때문에 그것은 단지 비어있는 것 같아요. 나는 그것을 다시 업데이트했습니다. :) –