1 Reply Latest reply on Feb 22, 2011 11:21 PM by Nick Belaevski

    ModalPanel not able to see the seam component

    newbee07 Newbie

      We have a issue with richfaces modalPanel where when using with datalist, its not showing the selecteditem on the modalpanel but it shows the previously selected item.

      So on the first visit of thepage, the modal shows nothing, but when I refersh the page and click on any other item, I see the first slected item.

      Below is the page code.

       

          <rich:modalPanel id="myModalPanel" autosized="true" zindex="2000">

       

              <f:facet name="controls">

                      <span style="cursor:pointer" onclick="javascript:Richfaces.hideModalPanel('myModalPanel')">X</span>

              </f:facet>

       

              <a4j:outputPanel id="myModalDiv" layout="inline">

                  <h:outputText value="#{selectedItem.name}"/> <br/>

                  <h:outputText value="#{selectedItem.decription}"/> <br/>

       

              </a4j:outputPanel>

       

          </rich:modalPanel>

       

       

          <rich:dataList var="l_item" value="#{listedItems}" rows="5" type="disc" title="Your Items">                

       

                      <a4j:commandLink id="showItem" action="#{SeamComponent.view}" oncomplete="Richfaces.showModalPanel('myModalPanel',{width:550, top:200});" rerender="myModalDiv">

       

                               <h:outputText value="#{l_item.name}"/> <br/>

       

                      </a4j:commandLink>              

       

       

          </rich:dataList>

       

      SeamComponent.view() basically logs the selected item. ON the server side the "selecteItem" is being populated accurately with the selected item from the list.