Databases Reference
In-Depth Information
Using Static HTML
A simple and obvious way to create a customized user interface is to simply create a region of type
HTML. HTML regions simply display the HTML content. Three types of HTML regions exist: HTML,
HTML with Shortcuts, and HTML that escapes special characters. The standard HTML text simply
renders the HTML as typed. If you are comfortable writing static HTML, this can be a convent way to
create static page content.
HTML with Shortcut regions allows you to type HTML, with double quoted shortcut names. The
example in Figure 12-11 can be referenced in the source of an HTML region using "DELETE CONFIRM MSG" .
Basically, regions of type HTML with shortcuts parse the HTML for double quoted shortcuts, and when
found replace the double quoted text with dynamically or staticly defined content. The example of the
DELETE CONFIRM MSG allows the message to be defined in one place yet referenced many places.
Figure 12-11 . APEX source of the shortcut DELETE_CONFIRM_MSG
Using PL/SQL to Generate HTML
Sometimes you may want full control over HTML—sometimes you just have a need to define a unique
display control that is not available by any declarative component. You can do this by creating plug-ins
which define your own declarative display controls; for example, region controls or item controls (see
Listing 12-8). Additionally, you can also render content using PL/SQL region types. A PL/SQL region
allows you to generate anything you want into a page. This gives APEX developers the ability to generate
virtually any HTML page content.
Listing 12-8 . PL/SQL Region Used to Generate HTML
declare
c := 0;
begin
sys.htp.p('<div class="nice-format"><strong>Past Due Projects</strong>: <span>');
for c1 in (select name from projects where status = 'OPEN' order by due date asc) loop
c := c + 1;
if c > 1 then
sys.htp.prn(', ');
Search WWH ::




Custom Search