o7planning

Create Dynamic Content Region in Oracle APEX (PL/SQL Dynamic Content)

  1. Introduction
  2. Creating dynamic HTML content region

1. Introduction

This document is based on:
  • Oracle APEX 5.0

Use 'PL/SQL Dynamic Content' you can create any HTML content within a region.

2. Creating dynamic HTML content region

Create a Blank Page:
  • !
Create new region:
  • !
  • PL/SQL Code
Declare
   Cursor c_Dept Is
      Select Deptno
            ,Dname
            ,Loc
      From   Dept;
   --
   Cursor c_Emp(p_Deptno Number) Is
      Select Empno
            ,Ename
            ,Job
      From   Emp
      Where  Emp.Deptno = p_Deptno;
Begin   
   Htp.p('<div class="mytree-container">');
   --
   For Rec_d In c_Dept Loop
      Htp.p('<ul>');
      Htp.p('<h4>' || Rec_d.Dname || '</h4>');
      --
      For Rec_e In c_Emp(Rec_d.Deptno) Loop
         Htp.p('<li>' || Rec_e.Ename || '</li>');
      End Loop;
      --
      Htp.p('</ul>');
   End Loop;
   --  
   Htp.p('</div>');
End;
Running the example:
Custom Style (CSS)
  • TODO