I am currently having an interactive report in ORACLE APEX, where i use the report to display many records as rows and columns from the database. One such column is the check box.All the check boxes in the report are rendered like this : APEX_ITEM.CHECKBOX2(1,GROUP1.CAM_QER_LINE_GROUP_ID,'UNCHECKED',p_item_id=>'p01_1')
There are buttons in the report such as 'Save' which save the changes made to the records in the report.
On clicking the Save button, all the changes made to the checked records should be going through successfully, else an alert/message or similar kind should pop-up and ask the user to check the box and save the changes.
I know there are multiple ways to do this. The ways that i have tried so far but wasn't completely successful are mentioned below.
if apex_application.g_f01.count = 0
then
apex_error.add_error (
p_message => 'Invalid Customer ID!',
p_display_location => apex_error.c_inline_with_field_and_notif,
p_page_item_name => 'P5_CUSTOMER_ID');
else
--- DO THE REST
In this above method, I am using this code in the PL/SQL process which runs at the point of processing after clicking of the Save Button but the problem that I am facing is once the error_message is displayed, it gets re-displayed on click of even other buttons which do a submit of the page/other processing, which defeats the purpose.
if (document.getElementById('p01_1').checked)
{ alert("checked"); }
else
{ alert("Please Check the Box."); }
In this above method, the problem is that getElementById('p01_1') is not able to identify each checkbox in the report and is throwing the alert 'Please Check the Box' even if some out of all check boxes are checked.
Looking for a simple solution to this problem that I am facing.
<td class=" u-tL" headers="C616135092723269676"><div align="center" style="width:56px !important;"><input type="checkbox" name="f01" value="43219611" UNCHECKED /></div></td>
– Arpan Roy