Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6589817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:13:23+00:00 2026-05-25T17:13:23+00:00

I am using Oracle ApEx and have a standards SQL Report with the following

  • 0

I am using Oracle ApEx and have a standards SQL Report with the following apex_item.checkbox call, i.e.:

select 
apex_item.checkbox(1, empno) cbox, 
"EMPNO",
"ENAME",
"JOB",
"MGR",
"HIREDATE",
"SAL",
"COMM",
"DEPTNO"
from "EMP" 
where 
( 
instr(upper("ENAME"),upper(nvl(:P1_REPORT_SEARCH,"ENAME"))) > 0 or
instr(upper("JOB"),upper(nvl(:P1_REPORT_SEARCH,"JOB"))) > 0 
)

My problem is, apart from having this report within one of my pages, I also have other items on the page that are required fields, so when the user clicks on 3 of the 10 checkboxes based on the above SQL and submits the page, the user is presented with an error, indicating that an item on the page is required.

Now when the user is presented with this error, the 3 out of 10 checkboxes that were checked are now unchecked.

Can I maintain checkbox persistence/state based on the above scenario? as I don’t want the user re-checking the records they already checked.

I am interested in solving this with an Oracle ApEx means if possible. However, a jQuery approach may also work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:13:23+00:00Added an answer on May 25, 2026 at 5:13 pm

    i found some way to do this, with a mix of apex and jquery:

    • On submit process: get the state of the checkboxes (through apex_application) and store them through apex_collections

    • After resfresh: get the values through an ajax callback and set them again with some javascript code.

    I made a report (Report 1), based on emp, with your query (but left out the where-clause).
    Page overview

    My on-submit process where i get the checked boxes (through apex_application you only get the checked ones!), and keep them in a collection. This collection is created or emptied each submit. I left the debug
    messages in, so you might track them.
    Oh, and the value stored is empno, since you based the checkbox item on that column, and not 1 or 0.

    apex_debug_message.log_message('on submit point');
    APEX_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION('COLL_REPORT1');
    
    FOR i IN 1..APEX_APPLICATION.G_F01.COUNT LOOP
    apex_debug_message.log_message('loop chk: '||i||': '||TO_NUMBER(APEX_APPLICATION.G_F01(i)));
       APEX_COLLECTION.ADD_MEMBER(p_collection_name => 'COLL_REPORT1', 
                                  p_n001 => TO_NUMBER(APEX_APPLICATION.G_F01(i))
                                  );
    END LOOP;
    

    Then create an ajax callback process:
    I make a json array here, which simply holds the values of the checkboxes, and helps me easily parse the values afterwards. Collection is truncated after retrieval.

    DECLARE
       v_first BOOLEAN := TRUE;
       v_json VARCHAR2(4000);
    BEGIN
       v_json := '[';
       FOR r IN (SELECT n001 FROM APEX_collections
                  WHERE collection_name = 'COLL_REPORT1')
       LOOP
          apex_debug_message.log_message('stored value: '||r.n001);
          IF NOT v_first THEN
             v_json := v_json ||',';
          ELSE
             v_first := FALSE;
          END IF;
          v_json := v_json || r.n001;
       END LOOP;
    
       v_json := v_json || ']';
    
       APEX_COLLECTION.TRUNCATE_COLLECTION('COLL_REPORT1');
    
       htp.p(v_json);
    END;
    

    Then the values need to be retrieved and set, which is done through a dynamic action.

    Dynamic action details

    • Event: after refresh
    • Selection type: Region
    • Region: (your report region, mine is Report 1)
    • No condition

    The code:

       var oDBGet = new htmldb_Get(null, &APP_ID., 'APPLICATION_PROCESS=get_checked_boxes', &APP_PAGE_ID.);
       var arrBoxes = jQuery.parseJSON(oDBGet.get());
    
       $.each(arrBoxes,
              function( intIndex, objValue ){
                 $("input[name='f01'][value='"+objValue+"']").attr("checked","checked");
              });
    

    This code simply calls the ajax callback and parses the returned string as a json object (which is an array due to [value,value,value] syntax).
    I then loop over this array and set the values on the input elements with name f01 (dynamically created checkboxes, this is the based on the id given to apex_item.checkbox), and where the value equals that of the value we have stored. Through attr the box gets checked!

    Here’s hoping i didn’t overdo it 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using: Oracle ApEx 3.0.1 I have a SQL report region that contains a hidden
I'm using Oracle APEX and I have a report region in a page that
I am using Oracle SQL (in SQLDeveloper, so I don't have access to SQLPLUS
Using Oracle 11g release 2, the following query gives an ORA-01790: expression must have
I have menu designed using jQuery in oracle apex.The menu is like this Parent1
Using ORACLE SQL. I have a table ' Employees ' with one of the
I'm using Oracle APEX but am unsure how to access the following variables from
I am using Oracle Sql Developer I have a huge script that creates tables,
I am using Oracle SQL (in SQLDeveloper, using the SQL Worksheet). I would like
Friends, I'm converting an Oracle Form to Apex and have run into problem(s?) which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.