2 Replies Latest reply: Nov 27, 2012 12:18 AM by 962768 RSS

    Dynamic DHMTL tree with checkboxes

    Luis Cabral

      I would like to know if this is possible to be done:
      [-] Level 1 [X]
         [-] Level 2 [ ]
                Level 3 [ ]
         [+] Level 2 [ ]
      [+] Level 1 [X]
      [+] Level 1 [X]
      I.e., a DHMTL tree whose items can be dynamically collapsed/expanded. I know how to implement this.

      The problem I have is that, next to each item (in all levels) there must be a checkbox so the user can select any number of items (in any level). How can I implement this?

      So far, I created a checkbox called P27_LEAGUES with only one option "All" and a region based on this code:
      for r1 in (select distinct eventgroup_id2 id, eventgroup_name2 name
                 from dw_event_groups_mvw
                 order by 1)
        htp.p('<li><INPUT TYPE=CHECKBOX NAME="P27_LEAGUES" VALUE="'||r1.id||'"/>' ||
                      r1.name || '</li>');
      end loop;
      This displays fine, but if I tick any checkbox and submit the page, I get an 404 error! If I submit the page without ticking any checkbox, it branches to itself without error.

      Obviously Apex 3 is not easily fooled by my trick and my approach does not work! Any suggestions?

      BTW I need to use a cursor because I will create the levels in the tree nesting UL tags (the code is not complete yet).

        • 1. Re: Dynamic DHMTL tree with checkboxes
          Luis Cabral

          I got it! I changed the checkbox name in the code to p_v01 and it worked as expected!

          I can continue working on my solution now...

          • 2. Re: Dynamic DHMTL tree with checkboxes
            Hello Luis,
            I am facing the same problem n luckily i found your post about the same..
            thanks for the code..
            but , I tried a lot , doesn't able to attach check boxes at each node of tree

            Will you please explain how to do that, please elaborate if you can...

            my tree view is working fine..
            i can select particular node value and process it from tree view..everything is working as expected except check box with tree node
            I am woking in Forms 6i

            Edited by: Dheeraj India Nagpur on Nov 26, 2012 10:13 PM