Apex Collection - tracking changes/updates on cells
I created an apex collections page which displays and allows user to update the array/matrix/cells.
I created a button to apply and save the changes; this process is working fine for update/insert as necessary.
--
I'm struggling on a couple of points:
1. If the user gets out of the page or do a refresh, I wanted to show an error or message that when a cell has been updated in the page, to display an error-like " that there are unsaved changes". And let them click on the update button I created. I read that there is the function called COLLECTION_HAS_CHANGED however, I'm not quite sure how to make it work with Dynamic Action.
Any guidance is greatly appreciated. Thanks.
2 Updating a cell value from not null to null is a bit of a challenge.
The question is: Is there a way to find if a cell's value is changed from not null to null during the time I'm performing update_member_attribute ?
(The update_member_attribute I found on the forum and I am using is handling it using IS NOT NULL -- I think this is good because it will avoid me getting a bunch of records inserted if the cells are indeed NULL (before and after).
--
below is the part of the code I'm referring to ...
FOR i IN 1.. APEX_APPLICATION.G_F02.COUNT LOOP
IF apex_application.g_f02 (i) IS NOT NULL THEN
APEX_COLLECTION.UPDATE_MEMBER_ATTRIBUTE (
p_collection_name => 'COLLECTION1',
p_seq => i,
p_attr_number => 2,
p_attr_value => apex_application.g_f02 (i));
END IF;
END LOOP;
--
I could removed the NOT NULL IF condition, but I only wanted to do the null update when there was a value previously.
Thanks.