3 Replies Latest reply on Mar 27, 2010 1:41 PM by tyshan.tyshanchn.gmail.com

    hi, unexpected updates in ModalPanel

    tyshan.tyshanchn.gmail.com

      Hi,


      I show a datas List in one rich:dataTable


      so it is like in .xhtml page/




      <rich:dataTable value="#{modelDatasList}" var="_data" rendered="#{not empty modelDataList}">
              <rich:column>
              <f:facet name="header">name</f:facet>
                    <a:commandLink immediate="true" ajaxSingle="true"      action="#{modelActionHome.wire}"  value="editLink" oncomplete="javascript:Richfaces.showModalPanel('editModalPanel')"/>
               </rich:column>
      </rich:dataTable>





      when click the link editLink in rich:dataTable,


      it will show a modalPanel, then edit one field name of the existed Model in ModalPanel;


      class Model looks like




      Model{
      private String name;
      //get and set method;
      .....
      }






      In the rich:modalPanel, the codes look like:



      <h:form>
      <h:inputText value="#{_model.name}"/>
      <a:commandLink oncomplete="Richfaces.hideModalPanel('editModalPanel')" value="cancel"/>
      </h:form>







      But my question is that, when I input some in the inputText to update the existed MODEL value of NAME in ModalPanel.
      then click the link cancel to close the ModalPanel.
      Again I click the same Link editLink in rich:dataTable to show the modalPanel for updating,
      I will see the changed value for Model's name, just inputed.


      if I click the another link editLink in rich:dataTable to show the modalPanel for updating,
      in ModalPanel,the value of model name is changed to be what I just input last time.


      why, I hope to get a refresh value of Model from DB, every time in ModalPanel, when I click the editLink from rich:dataTable.


      if I click the link cancel in ModalPanel, the changed value should be discard!


      Is there any way for this?




      I even test with s:conversationPropagation type="nest" and end the conversation in link cancel in ModalPanel.
      




      but failed!


      Any good way for the above requirement?


      Sincerely



      Tyshan