2 Replies Latest reply on Feb 27, 2007 1:23 AM by surajmundada

    DataModel selection not getting outjected

      Hi,

      I am using Seam 1.0.0

      I have a seam managed session bean in which I have declared a datamodel and its factory method.

      @Out(required = false)
      @DataModel
      private List<AnalysisSummaryReadingsUI> analysisSummaryReadingsUIList;
      
      @Out(required = false)
      @DataModelSelection(value = "analysisSummaryReadingsUIList")
      private AnalysisSummaryReadingsUI analysisSummaryReadingsUI;
      
      @Factory("analysisSummaryReadingsUIList")
      public void populateAnalysisSummaryList()
      {
       // code here
      }
      


      When I click a row of this datamodel on UI, a method is called in the same bean only.


      public String showCategoryGraph()
      {
       print(analysisSummaryReadingsUI);
       Events.instance().raiseEvent("populateGraphPath");
      }
      


      The print function gives the expected values of "analysisSummaryReadingsUI" after which event is raised to execute another method from another bean. This bean injects the same variable and makes use of the clicked row (DataModelSelection).

      @In
      private AnalysisSummaryReadingsUI analysisSummaryReadingsUI;
      
      @Factory("chartPath")
      public void populateGraphPath()
      {
       logger.debug(helper.formatLogMessage("In factory method"));
       calculateGraphValues();
      }
      
      private void calculateGraphValues()
      {
       print(analysisSummaryReadingsUI);
      }
      



      But this print function is giving me values of the first row of the datamodel instead of the clicked row.

      Both the beans are is Session scope and seam managed.

      What is going wrong here ?

      Regards,

      Suraj