【问题标题】:richfaces 4.0.0 rich:popupPanel not showingrichfaces 4.0.0 丰富:popupPanel 未显示
【发布时间】:2011-06-16 22:44:18
【问题描述】:

如何在richfaces 4 m5 中显示rich:popupPanel?下一个代码对我不起作用。

<a4j:commandLink value="#{bean.phone}" render="popDiv" execute="@this" >
    <f:setPropertyActionListener target="#{personController.person}" value="#{bean}" />
    <rich:componentControl target="personModalPanel" operation="show" event="onclick" />
</a4j:commandLink>
<rich:popupPanel id="personModalPanel" modal="true" width="200" height="200">
        <f:facet name="header">
            <h:panelGroup>
                <h:outputText value="Edit Person" />
            </h:panelGroup>
        </f:facet>
        <f:facet name="controls">
            <h:panelGroup>
                <h:graphicImage value="/resources/img/x.png" styleClass="hidelink" id="hidelink" >
                    <rich:componentControl target="personModalPanel" operation="hide" event="onclick" />
                </h:graphicImage>
            </h:panelGroup>
        </f:facet>
</rich:popupPanel>

【问题讨论】:

    标签: jsf richfaces jsf-2


    【解决方案1】:

    这里是弹出面板的核心。

           <a4j:commandLink value="Register"
                         onclick="#{rich:component('regWizard')}.show()">                            
        </a4j:commandLink>
        <rich:popupPanel id="regWizard"
                         autosized="true"
                         modal="true"
                         onmaskclick="#{rich:component('regWizard')}.hide()">
            <f:facet name="header">
                <h:outputText value="Registration Wizard" />
            </f:facet>
            <f:facet name="controls">
                <h:outputLink value="#"
                              onclick="#{rich:component('regWizard')}.hide(); return false;">
                    X
                </h:outputLink>
            </f:facet>
        </rich:popupPanel>
    

    【讨论】:

    • OK 这会打开模态面板,但返回 false 会导致提交不发生。
    【解决方案2】:

    在 Richfaces 4 中,您需要编写不带“on”字样的事件名称。所以给定的代码应该适合你。

    <a4j:commandLink value="#{bean.phone}" render="popDiv" execute="@this" >
        <f:setPropertyActionListener target="#{personController.person}" value="#{bean}" />
        <rich:componentControl target="personModalPanel" operation="show" event="click" />
    </a4j:commandLink>
    <rich:popupPanel id="personModalPanel" modal="true" width="200" height="200">
            <f:facet name="header">
                <h:panelGroup>
                    <h:outputText value="Edit Person" />
                </h:panelGroup>
            </f:facet>
            <f:facet name="controls">
                <h:panelGroup>
                    <h:graphicImage value="/resources/img/x.png" styleClass="hidelink" id="hidelink" >
                        <rich:componentControl target="personModalPanel" operation="hide" event="onclick" />
                    </h:graphicImage>
                </h:panelGroup>
            </f:facet>
    </rich:popupPanel>    
    

    【讨论】:

      猜你喜欢
      • 2013-04-30
      • 2011-07-16
      • 2012-04-09
      • 2012-11-17
      • 1970-01-01
      • 2011-10-14
      • 1970-01-01
      • 2011-02-11
      • 2011-10-15
      相关资源
      最近更新 更多