【问题标题】:Can we display the p:editor in the dialog?我们可以在对话框中显示 p:editor 吗?
【发布时间】:2015-02-03 13:16:22
【问题描述】:

嗨,当我尝试将 p:editor 带入对话框时,它没有显示。如何将其带入对话框??

 <p:commandButton value="Submit" update="display" oncomplete="dlg.show()" icon="ui-icon-disk" />

<p:dialog header="Content" widgetVar="dlg" showEffect="fade" hideEffect="fade">
    <p:editor id="editor" widgetVar="editorWidget" value="#{editorView.text}" width="600" />
   </p:dialog>

它的呈现方式

<div id="form1:editorsad" style="visibility:hidden">
<textarea id="form1:editorsad_input" name="form1:editorsad_input"></textarea>
</div>

但正常的 p:editor 不会像这样在对话框内呈现

<div id="form1:editor" style="">
<div class="ui-editor" style="width: 600px; height: 250px;">
<div class="ui-editor-toolbar" style="height: 53px;">
<textarea id="form1:editor_input" name="form1:editor_input" style="display: none; width: 600px; height: 197px;"></textarea>
<iframe frameborder="0" src="javascript:true;" style="display: block; width: 600px; height: 197px;">
</div>
</div>

如何解决这个问题??

【问题讨论】:

  • 您使用的是哪个 PF 版本?你有 JS 错误吗?
  • 在 PrimeFaces 5.1 上运行良好(在 JSF 2.3.0-m01 上运行)。我刚刚更改了&lt;p:commandButton&gt;oncomplete 属性的值,以反映PrimeFaces 4.0 之后所做的新更改oncomplete="PF('dlg').show()"
  • 我正在使用 primefaces 3.3.1,但对话框和编辑器的渲染器类没有太大变化......我没有收到任何 js 错误,只有警告..

标签: jsf primefaces


【解决方案1】:

我找到了无法加载内容的解决方案,因为它未能通过 dialog.js-Line No:136 中的条件(包含在 primeface jar 3.3.1 中)
----------------if(!this.loaded && this.cfg.dynamic) ------------------ 在“显示:函数()”中......如果那个'if'条件通过this.loadContents();将执行并加载编辑器组件内容。我在“如果”条件之外使用了 this.loadContents() 能够获得该“编辑器”组件。我不确定“如果条件失败,为什么会这样”。任何人都可以告诉为什么如果条件失败?????

【讨论】:

    猜你喜欢
    • 2018-01-30
    • 1970-01-01
    • 1970-01-01
    • 2015-12-03
    • 1970-01-01
    • 2021-12-08
    • 1970-01-01
    • 1970-01-01
    • 2013-07-04
    相关资源
    最近更新 更多