Richfaces 4 a4j:commandLink action not firing in rich:popupPanel

最后都变了- 提交于 2019-12-03 17:00:20

Ok, so I fixed it myself. After screwing around I worked out that I just need to add an <a4j:region> around the content in the <rich:popupPanel>. So now the xhtml looks something like this:

<rich:popupPanel id="rate-panel" modal="true" height="444" width="780" top="60" show="false" onmaskclick="#{rich:component('rate-panel')}.hide()" styleClass="cs-modal">
  <a4j:region id="panel-region">
    /**Some html here**/    
    <a4j:commandLink immediate="false" action="#{venueScore.up}" render="panel-region" styleClass="rate love">
      <span>Love it</span>
    </a4j:commandLink>    
    /**Some more html here**/    
  </a4j:region>
</rich:popupPanel>

I had the same problem, a4j:commandLink only worked after first click.... put the poppanel inside a form and add domElementAttachment...

<h:form id="myform">
    <rich:popupPanel id="pop" domElementAttachment="form">
        ...
        <a4j:commandLink />
        ...
    </rich:popupPanel>
</h:form>

I know that it's an old question but as I had exactly the same problem, I spent a lot of time before fixing it, maybe it will help someone else. First, I tried the solution proposed above but it did not worked. Finally, I found this thread: Issues closing rich:popupPanel via show condition, RF 4.0

And I added the domElement attribute to my popup:

<rich:popupPanel 
id="newMailPopup" 
**domElementAttachment="form"** 
...>

And now, my a4j:commandLink works perfectly :-)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!