Thursday, 5 April 2007

Checkbox Nightmare


There are only very few things in ApEx you could describe as critical. One of those, for sure, are checkboxes in tabular forms. I had a requirement to use those items in a updatable tabular form for setting simple flags like "Y" or "N", by clicking a checkbox. You will agree, this isn't something special if you think of oder programs operating on databases - evan Access has this functionality.

I spent several hours trying to solve that issue and finaly I had to give up. I asked Patrick Wolf, our expert for tabular forms for help. He was so kind to look into the application and correct it. And it worked. You can see the example here.

My request to the ApEx team:

Please solve this issue in one of the next releases. I can't really sell this problem to my customers. It is too trivial to be taken serious. Thanks.


7 comments:

  1. Denes,
    What is the function of the tick boxes?
    cheers
    Bjorn

    ReplyDelete
  2. Dear Denes,

    first of all it's a shock to me how complicated is the checkbox issue on APEX. I totally agree with your request for the development team. However, lately I just had to make a checkbox involved "delete messages" page and I just managed to make it quite simple. This solution might help other ones thus I'd like to share it.

    The base of my solution is the APEX-like_AJAX: javascript + on Demand Application Process combo.
    If the checkbox is checked an onChange event triggers an on Demand Application Process which puts the value (here: message ID) into a temporary table. Next, when user clicks the "Delete selected messages" button a page process just makes the rest of the process (erases messages from the table of messages based on the IDs in the temporary table). Last step is to flush the temporary table.

    Hope someone will find this helpful.

    All the bests,

    Zahoo

    ReplyDelete
  3. Hi Denes

    Yes checkboxes can be a nightmare in APEX.
    Thanks for this article.
    I checked also this one :
    http://htmldb.oracle.com/pls/otn/f?p=31517:95:472341346271226:pg_R_4543909217427606558:NO&pg_min_row=1&pg_max_rows=7&pg_rows_fetched=7

    How can we keep (in session) the checkbox checked in a tabular form or report with pagination , when navigating from one page to another.
    Thanks

    ReplyDelete
  4. I could imagine doing that only by using ajax and collections.

    Denes Kubicek

    ReplyDelete
  5. and could be done in APEX 3.0 i suppose (or should i upgrade to 3.1 or 3.2). I found this excellent tip : http://apex-smb.blogspot.com/2009/01/apex-report-with-checkboxes-advanced.html

    I suppose i need to ajaxify my pagination and datagrid rendering.

    Thanks

    ReplyDelete
  6. pepecristiano@yahoo.com25 September 2009 at 15:01

    The checkboxes issue is trivial when you change it to ajax. You dont need any more the sloppy approach of two nested loops to iterate through. Simply make a listener in javascript and once triggered a box send it off to a pl sql process on demand. By means of associative arrays you can carry out a query with an O(1). Ajaxized all your applications. That advice is worth more than gold.

    ReplyDelete
  7. hello mate. i wrote you an email to ask for a user name and a password for apps. can you please answer?
    thank you.
    gabriel

    ReplyDelete