Understanding Oracle Apex_Application.G_Fnn and How to Use It

I am very confused about how oracle apex_application.gfnn works and whether it works only for standard SQL reports in Oracle ApEx or only with SQL (updatable reports, i.e. tabular forms).

Basically, I am trying to achieve the following use of this SQL example, which is just a standard SQL report, but not sure what I'm trying to achieve is possible with this type or report, i.e.

select id,
       name,
       telephone,
       apex_item.checkbox2(10,id) as "Tick when Contacted",
       apex_item.text(20,my_date) as "Date Contacted",
       apex_item.textarea(30,my_comment,5,80) as "Comment"
from   my_table

Based on the above sql, suppose this SQL query returns 10 rows. Now, using the checkbox as the driving identifier, I check the box for all odd entries / lines, i.e. lines 1,3,5,7,9 and for each of these lines, also enter the date value (f20) along with the comment (F30 )

With this in mind, I want to create a page process that is called when the user clicks the Save button, which will iterate over these checked lines and save for each record, my date and my comment, but only for the lines that I selected.

So, based on the foregoing, I expect that in my table there will be 5 news lines with the following columns:

ID      MY_DATE      MY_COMMENT
1       26/08/2012   Comment A
3       27/08/2012   Comment B
5       28/08/2012   Comment C
7       29/08/2012   Comment D
9       30/08/2012   Comment E

Unfortunately, I'm not sure how to do this using apex_application.G_F10.COUNT

I want to have access to the contents of each of these array elements (f20) and f (f30) for each row in which I have checked the box.

Is this possible or did I misunderstand how apex_application.G_Fnn works?

If the above is not possible, pls let me know how can i achieve this?

Do I need a tabular report?

Any help would be greatly appreciated.

Thank.

+5
1

.

select apex_item.checkbox2(10, empno) select_me,
apex_item.text(20, empno) empno,
apex_item.text(30, ename)||apex_item.hidden(50, empno) ename
from emp

, . .
, - , . . , 10 3 . .
empno: .

:

DECLARE
   v_empno emp.empno%TYPE; 
   v_ename emp.ename%TYPE;
BEGIN
   --f10: checkbox
   --f20: empno
   --f30: ename
   --f50: empno again
   for i in 1..apex_application.g_f10.count
   loop
      for j in 1..apex_application.g_f50.count loop
         if apex_application.g_f10(i) = apex_application.g_f50(j) 
         then         
            -- access values for the selected rows in the other arrays
            v_empno := apex_application.g_f20(j);
            v_ename := apex_application.g_f30(j);

            apex_debug_message.log_message('Employee: '||v_empno||' - '||v_ename);
         end if;
      end loop;
   end loop;
END;

, , 2, 4 6, .

record selection and query output

:

debug output: BLAKE, JONES, FORD

, , .

+8

All Articles