richfaces 4.0.0 rich:popupPanel 未显示

发布于 2024-10-14 20:02:44 字数 1064 浏览 2 评论 0原文

我如何在 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>

How can i show a rich:popupPanel in richfaces 4 m5? The next code doesn't work for me.

<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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

四叶草在未来唯美盛开 2024-10-21 20:02:44

在 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>    

In Richfaces 4, you need to write event name without 'on' word. So the given code should work for you.

<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>    
染火枫林 2024-10-21 20:02:44

这是弹出面板的核心。

       <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>

Here is the core of the popup panel.

       <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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文