0

我在一个 xhtml 页面中有 a4j 命令按钮,在另一个页面中有弹出面板。我想在第一页打开命令按钮上的弹出窗口。命令按钮

授权.xhtml

<a4j:commandButton id="Add" value="Add New" type="submit"
   action="#{controller.add}"
   render=":addPopupForm:addPopupOp">
     <a4j:param value="true" assignTo="#{controller.ind}" ></a4j:param>
</a4j:commandButton>

addPopup.xhtml

<h:form id="addPopupForm">
    <a4j:outputPanel id="addPopupOp" ajaxRendered="true">
       <rich:popupPanel id="addPopup" domElementAttachment="parent" show="true"
          rendered="true" height="600" width="1000" >
            Row is added
       </rich:popupPanel>
   </rich:outputPanel>
</h:form>
4

2 回答 2

0

I'm not a richfaces user but in general JSF , you can't re-render elements which are not rendered in the first place.

So in your case you should point to addPopupForm , like this :

 <a4j:commandButton id="Add" value="Add New" type="submit"
   action="#{controller.add}"
   render=":addPopupForm" >

Or wrap the a4j:outputPanel with some wrapper that will be always rendered

Also, take a look at this: Can you update an h:outputLabel from a p:ajax listener?

于 2013-11-07T08:47:21.110 回答
0

仅仅渲染面板并不意味着显示它。您必须将弹出“显示”属性附加到属性:

show="#{bean.showPopup}"

在操作方法(action="#{controller.add}")中设置 showPopup 布尔值,然后执行 render="addPopupForm"

于 2013-11-08T05:02:19.297 回答