2 Replies Latest reply on Aug 16, 2009 12:45 PM by Youssef El Maroufy

    ModalPanel disappears when rerender

    Youssef El Maroufy Newbie

      Hi
      I try to reRender a ModalPanel when i click on a a4j:commandLink in a rich:extendedDataTable

      
      <ui:composition template="/template.xhtml"
       xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich"
       >
      
       <ui:define name="title">
       <h:outputText value="Gestion des banques" />
       </ui:define>
      
       <ui:define name="body">
      
       <h:form>
       <rich:tabPanel switchType="client">
       <rich:tab label="Ajouter une banque">
       test
       </rich:tab>
       <rich:tab label="Liste des banques">
       <rich:extendedDataTable value="#{BanqueRequest.banques}" var="banque" id="tableBanque" width="600px" height="300px" >
       <rich:column sortable="true" width="100px" label="Nom">
       <f:facet name="header">
       <h:outputText value="Nom"/>
       </f:facet>
       <h:outputText value="#{banque.codebanque}"/>
       </rich:column>
       <rich:column sortable="true" width="200px" label="Code">
       <f:facet name="header">
       <h:outputText value="Code"/>
       </f:facet>
       <h:outputText value="#{banque.nombanque}"/>
       </rich:column>
       <rich:column sortable="false" width="200px" label="Operations">
       <f:facet name="header">
       <h:outputText value="Operations"/>
       </f:facet>
       <a4j:commandLink ajaxSingle="true" reRender="panel" id="link" value="Supprimer" >
       <a4j:actionparam name="id" assignTo="#{BanqueRequest.selectedIdBanque}" value="#{banque.idbanque}" />
       <rich:componentControl for="panel" attachTo="link" operation="show" event="onclick"/>
       </a4j:commandLink>
       </rich:column>
       </rich:extendedDataTable>
       </rich:tab>
       </rich:tabPanel>
      
       <rich:modalPanel id="panel" width="350" height="100" >
       <f:facet name="header">
       <h:panelGroup>
       <h:outputText value="Modal Panel"></h:outputText>
       </h:panelGroup>
       </f:facet>
       <f:facet name="controls">
       <h:panelGroup>
       <h:commandLink value="x" styleClass="hidelink" id="hidelink"/>
       <rich:componentControl for="panel" attachTo="hidelink" operation="hide" event="onclick"/>
       </h:panelGroup>
       </f:facet>
       <h:outputText value="#{BanqueRequest.selectedIdBanque}"></h:outputText>
       </rich:modalPanel>
      
       </h:form>
      
       </ui:define>
      
      </ui:composition>
      
      


      the ModalPanel appear then disappears after 1 seconde !

      thanks