页面加载后动态添加Primefaces-Tags?

时间:2013-07-06 11:21:28

标签: ajax jsf dom primefaces

(简单?)问题:

在加载页面后,是否可以添加(并呈现)Primefaces-Components到DOM?


示例:

我有一些代码,里面有一个编辑器。在编辑器中,我输入了一些Primefaces-Code e。 G。带有后端操作的p:commandButton。

之后我提交了编辑的内容。

是的,是吗? G。可以把它放到一个h:outputFormat中,它会在提交后更新吗?


增加:

<h:form id="form">

    <p:editor id="editor" value="#{editorBean.value}" width="600"/>

    <h:panelGrid columns="2" style="margin-top:10px">
        <p:commandButton id="submitButton" value="Submit" update=":holder" icon="ui-icon-disk"/>
        <p:commandButton id="clearButton" type="button" value="Clear" onclick="editor.clear()"
                         icon="ui-icon-close" />
    </h:panelGrid>

    <p:dialog header="Content" widgetVar="dlg" showEffect="fade" hideEffect="fade" modal="true">
        <h:outputText id="display" value="#{editorBean.value}" escape="false" />
    </p:dialog>

</h:form>

<h:panelGrid id="holder">
    <h:outputText value="#{editorBean.value}" escape="false" rendered="#{not empty editorBean.value}"/>
</h:panelGrid>

enter image description here

0 个答案:

没有答案