0
votes

I'm very much new to oracle apex and have been constantly failing on creating tabular form for inserting data into my table. My scenario is as follows.

i have two tables 1. tasks(task_id, task_Name) 2. Efforts (Eff_id,Task_id,Hours_spent,NOtes).

I want to create a tabular form to insert data into Efforts table with the tasks that I've in Tasks table. I created the tabular form with the query below.

SELECT APEX_ITEM.CHECKBOX(1,TASK_ID) "TASK_ID",
       TASK_NAME,
       APEX_ITEM.TEXT(2,'')"HOURS_SPENT",
       APEX_ITEM.TEXT(3,'')"NOTES"
FROM TASKS;

but when I create the "after Submit" process to read the values of this report and tried to insert into my table effortS with the following code, something strange is happening. When i select the checkbox of row-1,2 and 3 then only row 1 is getting inserted into my efforts table but for the rest, only task id values are getting inserted not the whole row. I was missing "hours_spent and NOtes". in my efforts table for rows-2 and 3..here is my plsql block

BEGIN
FOR i in APEX_APPLICATION.G_F01.COUNT LOOP
INSERT INTO EFFORTS(EFF_ID,TASK_ID,HOURS_SPENT,NOTES)
VALUES (SEQ_EFFORTS.NEXTVAL,APEX_APPLICATION.G_F01(i),APEX_APPLICATION.G_F02(i),APEX_APPLICATION.G_F03(i))
END LOOP;
commit;
END;

Can Someone help me! if there's another way of doing my requirement, then I'm more than happy to do it..

1
Whenever possible, I would suggest using Interactive grids. They can do most of the same things Tabular forms do, but a whole lot better. APEX_ITEM is the stuff of nightmares for me, I spent multiple weeks fiddling with it and htp.p, If I could have done it in Interactive grids I would have in in instant, but sadly I needed something that could not be done, so please, try using Interactive grids, save yourself the torture. - TineO

1 Answers

0
votes

Welcome to the APEX community.

This is a classic problem, due to the nature of HTML

Get the values of the selected rows with checked checkbox

Note, the usage of tabular forms is also waning in favour of Interactive Grids.