Home » Developer & Programmer » Application Express & MOD_PLSQL » Manually created tabular form - how to conditionally hide a checkbox in MSIE? (Application Express 4.1.0.00.32, Oracle 10.2.0.3.0)
Manually created tabular form - how to conditionally hide a checkbox in MSIE? [message #562413] Wed, 01 August 2012 07:06 Go to next message
Littlefoot
Messages: 19335
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Hello everyone!

I *think* that the main culprit here is MS Internet Explorer, but ... let me explain what I'm trying to do.

Working environment:
- Application Express 4.1.0.00.32
- Oracle Oracle 10.2.0.3.0 running on MS Windows Server 2003
- Windows 7 Enterprise edition (my PC)
- Opera 12.00, Firefox 14.0.1, Internet Explorer 8.0.7600


There's a tabular form which is based on a result of hierarchical query. Users are supposed to examine stuff and check whether they have passed the validation or not. In order to do that, there's a checkbox in that tabular form which users check (or not).

What I'd like to do is to hide a checkbox for "heading" records which are recognized by LEVEL, so - if level <> 5 then don't display the checkbox.

Here's a test case (this table simulates results of a hierarchical query; LVL represents the LEVEL pseudocolumn):
create table test_tf
  (id      number,
   lvl     number,              -- level
   sifra   varchar2(10),
   naziv   varchar2(30),
   cb_nedo number(1)            -- checkbox
  );

insert into test_tf 
  select 1 id, 3 lvl, '1.1'     sifra, 'Heading 1 title' naziv, 0 cb_nedo from dual union
  select 2 id, 4 lvl, '1.1.1'   sifra, 'Heading 2 title' naziv, 0 cb_nedo from dual union
  select 3 id, 5 lvl, '1.1.1.1' sifra, 'Normal 1' naziv       , 0 cb_nedo from dual union
  select 4 id, 5 lvl, '1.1.1.2' sifra, 'Normal 2' naziv       , 1 cb_nedo from dual;


A tabular form is created by a wizard - page type is a classic report. SQL is (pay attention to APEX_ITEM.CHECKBOX2)
select
  apex_item.text(1, id, 2)     t_id,
  apex_item.text(2, lvl, 2)    t_lvl,
  apex_item.text(3, sifra, 4)  t_sifra,
  apex_item.text(4, naziv, 13) t_naziv,
  --
  apex_item.checkbox2(5, 
                      cb_nedo, 
                      case when lvl <> 5 then 'hidden="hidden"'
                           else case when cb_nedo = 1 then 'checked="checked"'
                                end
                      end
                     )     t_cb_nedo
from (select id,
             lvl,
             sifra,
             naziv,
             cb_nedo
      from test_tf
     )
order by id

Columns' attributes are modified so that their "Display As" property is set to "Standard Report Column". Finally, run the page.

The result is as follows:

./fa/10338/0/

As you can see, Opera and Firefox work correctly, while Internet Explorer shows checkboxes in heading level records.

Interestingly,
case when lvl <> 5 then 'disabled="disabled"'
disables these checkboxes, but I just can't hide them.

Would anyone know how to fix that? Unfortunately, IE is a "must" ...

Regards,

LF

[Updated on: Wed, 01 August 2012 07:12]

Report message to a moderator

Re: Manually created tabular form - how to conditionally hide a checkbox in MSIE? [message #562510 is a reply to message #562413] Wed, 01 August 2012 15:28 Go to previous messageGo to next message
andrew again
Messages: 2574
Registered: March 2000
Senior Member
Try style="visibility: hidden;" or style="display: none;" rather than hidden="hidden"
Re: Manually created tabular form - how to conditionally hide a checkbox in MSIE? [message #562513 is a reply to message #562510] Wed, 01 August 2012 15:45 Go to previous message
Littlefoot
Messages: 19335
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Hello, Andrew!

Thank you for the assistance - both options seem to be doing what I wanted!

Just to mention: I got the answer on OTN Forum less than hour ago (somewhat different than yours, though). It turned out that HIDDEN attribute belongs to HTML5 and it is supported by all browsers BUT Internet Explorer. According to Paul@OTN, I wasn't supposed to use that attribute anyway.

I'll do additional tests tomorrow (regarding tabular form array's values, querying & updating checkboxes); hopefully, at least one of 3 suggestions I got will be OK.
Previous Topic: APEX application protection
Next Topic: About Apex collection
Goto Forum:
  


Current Time: Wed Jul 30 15:24:23 CDT 2014

Total time taken to generate the page: 0.09126 seconds