1 Reply Latest reply on Jul 25, 2008 3:15 AM by sp sp

    dataTable+a4j:commandLink+modalPanel in RF3.1.6=no action

    sp sp Newbie

      Here's what I want:
      show items list in the main form,rich:tabPanel(datemodel)+edit/delete link(a4j:commandLink),click the link ,then show(pop-up) the panel ,and
      1. edit currentitems then update
      2. show currentitems then comfirm delete;
      my code:

      <!-- EditPanel -->
      <rich:modalPanel id="EditPanel">
       <f:facet name="header">
       <h:outputText value="Add/Update...." />
       </f:facet>
       <h:form id="mpform">
       <a4j:outputPanel ajaxRendered="true">
       <h:messages id="error"></h:messages>
       </a4j:outputPanel>
       <h:panelGrid columns="2">
       <h:outputText value="dm" />
       <h:inputText value="#{bean.dm}" size="10" required="true">
       <f:validateLength minimum="2" maximum="2" />
       </h:inputText>
       <h:outputText value="mc" />
       <h:inputText value="#{bean.mc}" size="20" required="true">
       <f:validateLength minimum="2" maximum="20" />
       </h:inputText>
       </h:panelGrid>
      
       <a4j:commandButton value="Update" action="#{bean.Update}"
       oncomplete="windowclose();" />
       <h:commandButton type="button" value=" Cancel " action=""
       onclick="Richfaces.hideModalPanel('EditPanel')" />
       <script type="text/javascript">
       function windowclose(){
       if (document.getElementById('mpform:error')==null){
       Richfaces.hideModalPanel('EditPanel');
       };
       };
       </script>
       </h:form>
      </rich:modalPanel>
      ..............
      <!-- list -->
      <h:from>
       <rich:dataTable width="100%" id="mydt2" rows="20" columnClasses="col"
       rowKeyVar="row" value="#{bean.allItems}" var="entry"
       footerClass="footer">
      
       <h:column>
       <f:facet name="header">
       <h:outputText value="NO." />
       </f:facet>
       <h:outputText value="#{row+1}" />
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="dm" />
       </f:facet>
       <h:outputText value="#{entry.mz.dm}" />
       </h:column>
      
       <h:column>
       <f:facet name="header">
       <h:outputText value="#{msgs.items_list_title}" />
       </f:facet>
       <a4j:commandLink id="updatelink" action="#{bean.processActionUpdate}"
       reRender='EditPanel'
       oncomplete="javascript:Richfaces.showModalPanel('EditPanel',{left:'auto', top:'auto'})">
       <h:outputText value="#{entry.mz.mc}" />
       </a4j:commandLink>
      
       </h:column>
       </rich:dataTable>
      
      </h:from>
      .........
      
      

      my problems is:
      when i add reRender='EditPanel' in the edit link ,the modalpanel does not show up;
      otherwise,the panel shows ,but in't filled with selected item's value;(the two inputtext is blank,but the action excuted)

      my environment:JSF1.1+myfaces-1.1.5+richfaces3.1.6,

      thank you!