richfaces 4.0.0 rich:popupPanel没有显示

时间:2011-01-28 00:23:32

标签: jsf richfaces jsf-2

我如何在4 m5的richfaces中显示一个富人: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>

2 个答案:

答案 0 :(得分: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>    

答案 1 :(得分: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>