Overblog Suivre ce blog
Editer l'article Administration Créer mon blog

Search

Free tool

Look and Feel Project

29 septembre 2011 4 29 /09 /septembre /2011 19:46

For once, this Forms entry is not about Java Beans or PJC, but only 100% Forms standard !

This new article show how you can select/unselect several records in a table-block, without any extra item in the block, but only a PL/SQL collection stored and managed in a PLL's package.

 

http://fdtool.free.fr/articles/multiselect/selected_records.jpg

 

 

Read the article

 

Francois

Partager cet article

Repost 0
Francois Degrelle - dans Oracle Forms
commenter cet article

commentaires

Philippe 27/11/2012 16:23


Hello François, As you can see I'm intensively using yiur code :0)


With the Muliselect mechanism, I have a problem : after processing the selected records I would like to clear the selection without doing an execute query Any suggestions ?   Using
pkg_multiselect.clear gives me an ORA-01403 when selecting other records and the previously selected records are still selected.


Thanks


 


Philippe

Francois Degrelle 27/11/2012 19:37



I have modified the pll method like this:


  --------------------------
  -- set the NUMREC value --
  --------------------------
  procedure set_state( numrec in pls_integer, value in pls_integer )
  is
    r pls_integer := 0;
    n varchar2(100) := name_in('system.current_form') || '.' || Name_in('system.cursor_block');
  begin
      r := find_record(n);
      if r > 0 then           
        tabrec(r).tab(numrec) := value ;
      else
          r := tabrec.count + 1;
          tabrec(r).name := n ;
          tabrec(r).tab(numrec) := value ;
      end if ;
        If value = 0 Then
            color_select_record (Name_in('system.cursor_block'), numrec, false);
        Else
            color_select_record (Name_in('system.cursor_block'), numrec, true);
        End if ;     
  end;


 


Then created a "clear button" with the following code:


declare
    rec pls_integer := 1;
begin   
    go_block('EMP');
    last_record;
    rec := get_block_property('EMP', current_record) ;
    first_record;
    for i in 1 .. rec loop
        pkg_multiselect.set_state( i, 0 );
    end loop;   
end;


That works fine for me.