2 Replies Latest reply on Dec 26, 2007 1:02 PM by Pete Muir

    testing dataTable

    alexandre russel Newbie

      I am trying to test dataTable.
      I can get/set data row using the list index.
      I am having a problem to pass an argument to a function:

      @Override
      protected void updateModelValues() throws Exception {
       setValue("#{administration.allProfils[0].lic}", "FOO");
      }
      @Override
      protected void invokeApplication() throws Exception {
      invokeMethod("#{administration.modifProfil(administration.allProfils[0])}");
      }
      


      When debugging this code I can see profil.lic being set to FOO but a different object is pass to the modifProfil function, and profil.lic got its original value.
      Could anyone got this to work ?
      The function and code works ok when deployed so the problem is not there.
      alex



        • 1. Re: testing dataTable
          alexandre russel Newbie

          The previous code never works when only using el, even when putting the setter in the invokeApplication block.
          The following code work:

           @Override
          protected void invokeApplication() throws Exception {
           Profil profil = (Profil) getValue("#{administration.allProfils[0]}");
           profil.setLic("FOO");
           Contexts.getConversationContext().set("profil", profil);
           assert invokeMethod("#{administration.modifProfil(profil)}") == null;
          }
          

          Does that make sens ?
          I believe that both code should work.
          alex

          • 2. Re: testing dataTable
            Pete Muir Master

            Yes, it should, if you can file a simple, reproducible example in JIRA we can take a look.