Databases Reference
In-Depth Information
end if;
sys.htp.prn(sys.htf.escape sc(c1.name));
end loop;
sys.htp.prn('</span></div>');
end;
The example in Listing 12-8 is very simplistic. It displays a comma separated list of project names
that are past due. The sys.htp.p call prints text with a trailing newline, the sys.htp.prn call prints text
without any trailing newline. The sys.htf.escape sc function is a function in the PL/SQL Web Toolkit
that escapes special characters to retain the integrity of your generated HTML.
Plug-Ins
Writing custom PL/SQL regions is powerful—plug-ins give you exact control over the user interface.
Some custom development efforts can be reused. For those cases where custom code is reusable, you
can convert the logic into an Oracle Application Express plug-in. Once a plug-in is created, it can be
installed into other applications, thus making the component reusable. Plug-ins function like native
declarative controls and can be used for regions, items, processes, and dynamic actions. The example in
Figure 12-12 shows a step in the Create Region wizard. Once the region type of Plug-in is selected, the
developer is prompted for the plug-in to be used and then, in a later wizard step, for the various plug-in
attributes.
Figure 12-12 . Application Express Create Plug-in Region wizard step
Separation of Presentation and Logic
APEX uses the Model-View-Controller architectural pattern to isolate the user interface look
(presentation) from the data manipulation (logic). Presentation is controlled by a number of
declaratively defined attributes, starting with the page template. When defining the rendering of a page,
the application developer may choose templates. Templates control the HTML used to render
application components. Applications and pages are discussed at length in this topic, but the point here
is that the logic used to render or display the data is separate and distinct from the logic used to update
database data.
Page processing, or data manipulation, is typically controlled by page processing attributes, most
commonly page processes. Page processes do not define user interface, except for error messages to be
raised in the event they fail.
The majority of the look and feel of an application is governed by the templates that are assigned to
display components such as pages, regions, items, and buttons. Many templates, of all types, are
combined into what is known as a theme . An APEX theme is selected when creating an application. If
you wish to change your look and feel you can do so by switching themes. Switching a theme will map
the templates used in the current theme to templates in the new theme. Each template type has many
classes but each template has only one assigned class. These template classes are used to appropriately
Search WWH ::




Custom Search