【问题标题】:How to active action method in h:commandButton in rich:popupPanel in richFaces 4.2.0如何在丰富的 h:commandButton 中激活操作方法:richFaces 4.2.0 中的popupPanel
【发布时间】:2012-04-09 10:01:48
【问题描述】:

就我而言,我想向我的 rich:popupPanel 添加一个操作,如下所示:

   <rich:popupPanel id="popup" show="#{tC5Bean.popupCheck}"  autosized="true" resizeable="false">
         <f:facet name="header">
        <h:outputText value="Simple popup panel" />
    </f:facet>
    <f:facet name="controls">
        <h:outputLink value="#" onclick="#{rich:component('popup')}.hide(); return false;">
            X
        </h:outputLink>
    </f:facet>
        <p>
        Hihi Click this button to hide
        <br/>
        <h:commandButton value="Close" onclick="alert('#{tC5Bean.popupCheck}')" action="#{tC5Bean.closePopupAction()}"/>
        </p>
    </rich:popupPanel>

像这样的托管 Bean:

public void closePopupAction(){
    //do some action
    popupCheck=false;
}

但是 closePopupAction 方法无法激活。我不知道这是什么原因以及如何解决这个问题。

如果您有任何想法,请与我分享。您可以在线查看我的错误并在以下位置下载我们的应用程序(请查看 testcase5):

http://phandanghung.wordpress.com/2012/03/22/welcome-to-my-jsf-tutorial-project/

衷心感谢。

【问题讨论】:

    标签: richfaces popuppanel


    【解决方案1】:

    您可以将 commandButton 更改为 a4j:

    <a4j:commandButton value="Close" oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('popup')}.hide()"/>
    

    您甚至不需要支持 bean 来关闭弹出窗口。

    【讨论】:

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