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.


Anonymous said...

What is the function of the tick boxes?

Anonymous said...

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,


Anonymous said...

Hi Denes

Yes checkboxes can be a nightmare in APEX.
Thanks for this article.
I checked also this one :

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

Denes Kubicek said...

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

Denes Kubicek

Anonymous said...

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 :

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

Thanks said...

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.

Unknown said...

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