This content has been marked as final. Show 9 replies
In other words:
Can I store the value of the GET Parameters (is this the right term??) into my page items?
E.g. The URL of my pagination button looks like this:
Can I store the value of pg_min_row, pg_max_rows and pg_rows_fetched into page items? How would that work?
Thanks a lot...
Scott, thanks for your immediate answer! In the APEX User's Guide I could not find anywhere the information about how to reference these values.
I try to explain once more, what I need the values for:
1. In the database I have a table called "ASSIGNMENTS". The table has two columns, "Customer_ID" and "Event_ID", which are both foreign keys to the tables Customer and Event.
2. Now I created a report which lists all Customers. I use HTMLDB_ITEM.CHECKBOX in order to display a checkbox for each customer in the first column. Some of the checkboxes are selected, some not. This depends on whether the customer is already assigned to a currently selected event or not.
3. After I uncheck a checkbox, which is checked in the beginning by default (as there is an entry of the customer in the table "ASSIGNMENTS") and I click "SAVE", the entry needs to be deleted from table Assignments. If I check a checkbox, which was not checked in the beginning, an entry for the checked customer needs to be added to table Assignments.
4. If I did not use the built in report pagination and just listed all customers together in the report (let's say 300 customers), it would be easy: I would just delete all entries for the selected event in table Assignments and then add a row for each of the customers who was submitted by the selected checkboxes.
5. Yet I do use pagination. Only 15 customers are displayed per page. Let's say I'm on the first page. 2 out of the 15 displayed customers are already assigned to the Event (they have an entry in table Assignments). If I uncheck the two assigned customers and then click "SAVE", I can not just delete all entries for the selected event from table Assignments. After clicking SAVE, only those customers should be removed from table Assignments, who are currently displayed on the page and have been un-checked!
Therefore, after the user clicks SAVE, I need to check all currently displayed customers (customer IDs), if they have an entry in the table assignments. That's what I need the values current_min_row, current_max_row etc. for.
Or is there an other way how to find out which customers are currently displayed on the page (I would need a table/array/list of all customer ids displayed on the screen).
Thanks again very much. Your help is appreciated a lot :)
I will jump in. :-) Just have a few minutes before a meeting.
I think you don't have to make it that complicated, where you have to know the current pagination.
1) Your HTMLDB_ITEM.CHECKBOX has to contain as checked value #ROWNUM# as the row selector would do it.
2) You have to create a hidden item where you store your customer id
3) create another hidden item where you store if the customer has already the assignment
4) In your process you are now able to loop through your arrays.
Haven't tested the code, but I think it should show the idea.
DECLARE vRowNumber BINARY_INTEGER; vFound BOOLEAN; BEGIN -- insert new event assignments FOR ii IN 1 .. WWV_Flow.g_f01.COUNT -- your checkbox LOOP vRowNumber := WWV_Flow.g_f01(ii); -- no assignment yet? IF WWV_Flow.g_f03(vRowNumber) IS NULL -- your hidden field where you store if you have an assmnt THEN INSERT INTO xxx VALUES (WWV_Flow.g_f02(vRowNumber)); -- your customer id END IF; END LOOP; -- delete old event assignments FOR ii IN 1 .. WWV_Flow.g_f03.COUNT -- your hidden field where you store if you have an assmnt LOOP -- only if the event was already assigned IF WWV_Flow.g_f03(ii) IS NOT NULL THEN vFound := FALSE; FOR jj IN 1 .. WWV_Flow.g_f01.COUNT -- your checkbox LOOP -- is the event still checked? IF WWV_Flow.g_f01(jj) = ii THEN vFound := TRUE; EXIT; END IF; END LOOP; -- IF NOT vFound THEN DELETE xxx WHERE CUSTOMER_ID = WWV_Flow.g_f02(ii); END IF; END IF; END LOOP; END LOOP;
Hope that helps
Check out my APEX-blog: http://inside-apex.blogspot.com
I have exactly the same problem.
my query is:
htmldb_item.checkbox(1,a.deal_id,decode(b.deal_id, null,null,'CHECKED')) sel,
from a, b
where a.deal_id = b.deal_id(+).
I tried to use following to handle the checked rows and unchecked rows:
First, update all rows in this page with a unchecked value:
FOR i in 1..HTMLDB_APPLICATION.G_F02.count
update b set del_ind = 'N',
where deal_id = HTMLDB_APPLICATION.G_F02(i);
Then use the following to update the checked rows:
FOR i in 1..HTMLDB_APPLICATION.G_F01.count
update b set check_ind = 'Y'
where deal_id = HTMLDB_APPLICATION.G_F01(i);
But the problem is that HTMLDB_APPLICATION.G_F02.count is always 0.
Can you tell me what I was missing?
Any response will be really appreciated.