3 Replies Latest reply: May 23, 2002 2:21 AM by 5001 RSS

    how to do multiple selection in multi-record block

    263633
      there is a multi-record block showing 5 records at a time with a scroll bar.
      two fields are placed next to next in the same block and displayed side by side inside a frame.
      how to proceed with multiple selection of these records?
      the situation is to delete the selected multiple records,help needed urgently
        • 1. re:how to do multiple selection in multi-record block
          5001
          BLOCK LEVEL TRIGGER WHEN-MOUSE-CLICK:

          declare
          rec_num NUMBER:=:SYSTEM.TRIGGER_RECORD; -- record number where clicked
          begin
          if not user_selection.tProductIds.exists(rec_num) then -- not selected
          /* save record number */
          user_selection.tProductIds(rec_num):=rec_num;
          /* select item, if multiple item in record call set_item_instance_property as many as needed*/
          set_item_instance_property('FORTH_PAGE_BLOCK.DESCRIPTION',rec_num, VISUAL_ATTRIBUTE,'SELECTED_RECORD_VA');
          else
          user_selection.tProductIds.delete(rec_num); -- already selected, deselect item
          /* deselect item, if multiple item in record call set_item_instance_property as many as needed */
          set_item_instance_property('FORTH_PAGE_BLOCK.DESCRIPTION',rec_num, VISUAL_ATTRIBUTE,'NOT_SELECTED_RECORD_VA');      
          end if;
          end;
          where:
          PACKAGE user_selection IS
          type tSelectedItems is table of NUMBER
          index by binary_integer;
          END;
          when delete:

          declare
          i BINARY_INTEGER;
          begin
          if user_selection.tProductIds.COUNT=0 then return; end if;     
          i:=user_selection.tProductIds.FIRST;     
          loop
          go_record(user_selection.tProductIds(i));
          delete_record;
               exit when i=user_selection.tProductIds.LAST;
               i:=user_selection.tProductIds.NEXT(i);
          end loop;
          end;
          • 2. re:how to do multiple selection in multi-record block
            263633
            thanx alexsandra.
            does this code features multiple selection that can be seen in the control when selected,cos current record visual attribute willonly apply for a single row.
            how do i proceed
            • 3. re:how to do multiple selection in multi-record block
              5001
              Code set visual attribute for item instance in selected row. This attribute not current record visual attribute. This set is saved, if you will select the following records. See built-in set_item_instance_property for help.