3 Replies Latest reply on Oct 23, 2009 5:02 PM by sai burgula

    Rich Datatable row selection issue

    sai burgula Novice
      I have implemented a rich:datatable with the capability that when you click on a row, the selected row details are displayed in a separate page.

        <rich:dataTable id="table" value="#{courseSearch.courseResultList}" var="var"
                rows="20" sortMode="single"
                                                                                      <a4j:support action="#{courseSearch.loadCourseOffering()}" event="onRowClick">
                       <f:setPropertyActionListener value="#{var}"
                                 target="#courseSearch.selectedCourse}" />
                                   <s:conversationPropagation type="join"/>
                 followed by rich:columns


      In the backing bean, I have getSelectedCourse and setSelectedCourse

              public void setSelectedCourse(CourseOffering selectedCourse) {
                this.selectedCourse = selectedCourse;

           public CourseOffering getSelectedCourse() {
                return selectedCourse;

      This is the backing bean  method being called.
                public String loadCourseOffering() {

                //System.out.println("Entered loadCourseOffering");
                String returnView = null;
                if (selectedCourse != null) {
                     courseoffering = courseDao.getCourseOffering(selectedCourse);
                if(courseoffering != null){
                     returnView = "viewCourse";
                     return returnView;

                     return returnView;

      NOW THE PROBLEM  IS I search for something the datatable gives me 20 rows of data.  I click on it the first time, the selected row details are not shown.  But if I click on another button on the page and come back to this SEARCH page, and then click on the row, the row data appears.

      Please let me know what the problem is, as I am having this problem since a long time and NOT able to find out what is causing this problem.