【问题标题】:open and close richfaces modal panel with jQuery使用 jQuery 打开和关闭 Richfaces 模式面板
【发布时间】:2014-06-26 03:49:52
【问题描述】:

我在一个项目中使用 Richfaces,并且出于某些需要,我必须在单击 div 后显示一个弹出窗口。 如何用jQuery打开和关闭richfaces模态面板?

panel.jsp:

<rich:modalPanel id="controlWorkflowEditor" width="430"
    trimOverlayedElements="false" resizeable="false" autosized="true">
    <f:facet name="header">
        <h:panelGroup>
            <h:outputText value="#{bpmnEditorLocal['choisirUnWorkflow']}">
            </h:outputText>
        </h:panelGroup>
    </f:facet>

    <h:form id="controlWorkflow">
        <h:panelGroup id="controlGroupPanelId">
            <table>
                <!--  ######### WORKFLOW CONTROL EDITOR  ############ -->
                <tr>
                    <td><h:outputLabel value="#{bpmnEditorLocal['workflow']} *" />
                    </td>
                </tr>
            </table>
        </h:panelGroup>
        <br />
        <br />
    </h:form>
</rich:modalPanel> 

【问题讨论】:

  • RichFaces 3 中,您可以在 javascript 中使用 Richfaces.showModalPanel('modalPanelId')。见Javascript API
  • 第二种方法是调用#{rich:component('modalPanelId')}.show()

标签: jquery jsf richfaces


【解决方案1】:

RichFaces 3.x 中,您可以使用 javascript 来显示/隐藏模式面板:

显示:

Richfaces.showModalPanel('modalPanelId')

#{rich:component('modalPanelId')}.show()

隐藏:

Richfaces.hideModalPanel('modalPanelId')

#{rich:component('popup')}.hide()

例子:

<h:graphicImage value="/images/icons/close.png" style="cursor:pointer" 
    onclick="Richfaces.hideModalPanel('modalPanelId')" />

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-05-18
    • 2012-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多