0 Replies Latest reply on Nov 28, 2012 5:41 PM by Chris Martin

    rich:popupPanel not closing after ajax render from a4j:poll

    Chris Martin Newbie

      I have a  a4j:outputPanel that renders a panel containing a  datatable. Within the datatable there is a link which opens a popupPanel.  I am using a a4j:poll to refresh the  outputPanel.  If

      the user has the popupPanel open when the poll refreshes the outputPanel the popupanel's controls will no longer work. I believe this is because when the panel contains the old generated

      id's  and when the outputPanel is refreshed the popupPanel is not aware of the new id's for the parent component.  Can anyone clarify what is happening and if possible provide suggestions to obtain the desired result of closing the popupPanel?



        <h:form id="equipmentDetailForm">

           <a4j:queue id="ajaxQueue" requestDelay="1" />



          <a4j:poll     id="poll" interval="20000" enabled="true" immediate="true"  bypassUpdates="true"  render="trendOutputPanel" actionListener="#{trendManager.setTrendlistSelectedSite}" />



      <a4j:outputPanel id="trendOutputPanel"   >


                <rich:panel >


                  <div class="results" id="trendList">



                    <h:outputText value="The trend search returned no results."

                                  rendered="#{empty trendList.resultList}"/>



                    <rich:dataTable   style="width:1400px" id="trendList"



                                    rendered="#{not empty trendList.resultList}">




                      <h:column   id="trendDesciptionId" styleClass="#{_trend.highlightedClass}">

                        <f:facet name="header">

                          <ui:include src="layout/sort.xhtml">

                            <ui:param name="entityList" value="#{trendList}"/>

                            <ui:param name="propertyLabel" value="Trend Description"/>

                            <ui:param name="propertyPath" value="trend.description"/>



                        <h:commandLink  id="trendDescriptionOutputLink"  >

                          <rich:componentControl target="trendDescriptionModal" operation="show" />

                          <h:inputText styleClass="#{_trend.highlightedClass}" size="35" value="#{_trend.description}"/>

                               <rich:tooltip value="#{_trend.description}"  />


                        <rich:popupPanel   moveable="true" style="position:absolute;top:0;left:0;height:300px;width:650px;text-align:left" autosized="true"

                                         modal="true" id="trendDescriptionModal" rendered="true">

                          <f:facet name="header">



                            <h:outputText value="Trend Description" />


                          <f:facet name="controls">

                            <a4j:commandLink  render=":equipmentDetailForm:trendOutputPanel"

                                          onclick="#{rich:component('trendDescriptionModal')}.hide(); return false;">

                              <h:graphicImage value="#{resource['img/close.png']}"

                                              id="modalPanelHideImage" styleClass="hideImage"/>





                          <br />

                           <h:inputTextarea  cols="120" rows="15" disabled="false"   value="#{_trend.description}" />
















      I have tried enclosing the panel in the a4j:poll rather than having it outside of it which did not have the desired effect. 


      Thanks for having a look