0 Replies Latest reply on Jan 13, 2016 9:07 AM by _JC_

    getRowSelection doesn't return all the selected rows from JTF_GRID?

    _JC_

      Hi Guru's,

       

      I have a JTF_GRID based on a spreadsheet...and I am allowing users to select multiple rows from this grid.

      Here are my codes:

      WHEN-NEW-BLOCK-INSTANCE

      *******************************************

      -- Purpose: To load task details in JTF Grid

      BEGIN

        IF :GLOBAL.L_LOAD_TASK_DET = 0 THEN

        XXLR_LOAD_TASK_DETAILS;

        END IF;

      END;

       

      XXLR_LOAD_TASK_DETAILS

      ******************************************

        jtf_grid.init ('BLK_JOB_TASKS.ITEM_GRID','XXLR_PLANNER_OVERVIEW_DS');

        jtf_grid.setbooleanproperty ('BLK_JOB_TASKS.ITEM_GRID',jtf_grid_property.fire_new_record_event,TRUE);

        jtf_grid.setbooleanproperty ('BLK_JOB_TASKS.ITEM_GRID',JTF_GRID_PROPERTY.ALLOW_MULTIPLE_ROW_SELECTION,TRUE);

        jtf_grid.setcharproperty ('BLK_JOB_TASKS.ITEM_GRID',jtf_grid_property.where_clause, l_where_cond);

        jtf_grid.setintproperty ('BLK_JOB_TASKS.ITEM_GRID',jtf_grid_property.db_fetch_size,50);

        jtf_grid.populate ('BLK_JOB_TASKS.ITEM_GRID');

       

      WHEN-BUTTON-PRESSED

      **************************************

      jtf_grid.RequestRowSelection('BLK_JOB_TASKS.ITEM_GRID');

       

      JTF_GRID_EVENT

      ******************************

        /* Capture the JTF GRID event */             

          l_event_type := jtf_grid.getCharProperty(jtf_grid_property. EVENT_TYPE);

          grid_name:=jtf_grid.getCharProperty(jtf_grid_property.EVENT_GRID); 

          IF l_event_type = jtf_grid_events.row_selection_event THEN

                  grid_selection := jtf_grid.GetRowSelection('BLK_JOB_TASKS.ITEM_GRID');

                  if grid_selection.COUNT > 0 then

                  for i in 1..grid_selection.COUNT

                  LOOP

                       l_startRow := grid_selection(i).startRow;

                       fnd_message.debug(jtf_grid.GetColumnCharValue('BLK_JOB_TASKS.ITEM_GRID', l_startRow, 'Task_No'));

                  end loop;  

                  END IF;

             END IF;

       

      Here is the Problem:

      Suppose i have 5 rows in my grid

      Task_Notask_nameTask_typeAssessor
      101DR-AssignDRMartin
      102SRSRPlummer
      103SRSRDell
      104DR-AssignDRJake
      105SRSRPekka

       

      After selecting task user needs to click on 'Go' button.

      I need to capture all the task_number that are selected by the user in the grid.

       

      However with the above code i did some testing and found these scenario's

      Scenario1:

      Selected row number 1,3,5:

      Rows returned by getRowSelection are also correct 1,3 and 5.

       

      Scenario2:

      Selected row number 1,2,3,5

      Rows returned by getRowSelection are NOT Correct. Rows returned only 1. Row number 2,3,5 are not returned.

       

      Scenario 3:

      Selected row number 2,4

      Rows returned by getRowSelection are also correct 2,4.

       

      Scenario4:

      Selected row number 2,3,4

      Only row number 2 is returned by getRowSelection .

       

      Scenario5:

      selected 3,4 in grid.

      Only row 3 is returned by getRowSelection .

       

      Analyzing all these above i found out if I am selecting rows by leaving the subsequent row then by getRowSelection returns correct value. if the subsequesnt row is selected then only first selected row number is returned.

       

      Any reason for this tricky behavior?

       

      Please help...Thanks in advance.