 |
|
APEX Application Page to use a JavaScript multi-level menu list
Oracle Tips by Burleson Consulting |
Setting up an Application Page
to use a JavaScript multi-level menu list

Before creating a region on the application
page for the MLIST you need to setup the page to use the cascading
style sheet and the JavaScript necessary to support the MLIST. It
is a little different depending on whether or not the CSS/JS is
stored in the repository or if the files are stored in the file
system. To setup the application page to use the MLIST do the
following.
- On the Page
Definition page click the Edit Attributes button.
- In the HTML
Header text area add the following:
If CSS/JS files
are in the repository
<link rel="stylesheet" href="#WORKSPACE_IMAGES#mlist.css"
type="text/css" />
<script src="#WORKSPACE_IMAGES#mlist.js"
type="text/javascript"></script>
If CSS/JS files
are in the file system
<link rel="stylesheet" href="#IMAGE_PREFIX#mlist.css"
type="text/css" />
<script src="#IMAGE_PREFIX#mlist.js"
type="text/javascript"></script>
- Apply Changes
The code shown above
can also be added to the Page templates, but I didn’t want to do
that at this time.
Using the MLIST package to populate a region on an application
page
For this example we
are still referring to the list above – named STAFF. To populate a
region on an application do the following:
-
Create a region of type PL/SQL Dynamic Content, click
Next.
-
Set Display Attributes
-
Set Title as desired
-
Set Region Template to Navigation Region
-
Set the display point to Page Template Region Position 2,
click Next.
-
Enter the text mlist.display_list( 'STAFF', 0 );, click
Next or Create Region.

- After the
region is created, modify the region attributes as follows (see
image below)
Header and Footer Text
Region Header
<table
width="175">
<div
class="t2VerticalSidebarList">
Region Footer
</div>
</table>
This was done this way instead of creating a new template just for
the time being. I have tested this in a list template and it works
fine, but there is still the matter of the proper width. If we make
a standard that all our side bars will be a certain width we can
update the appropriate templates.

Using the TEST list
A test list
procedure has been provided for testing and for initially building a
MList region. To see how the Mlist will be shown, this can be used
to display the MList during the initial building of application
pages before you have entered the data. Substituting the
mlist.display_list( 'STAFF', 0 ) as described above with the
following in the PL/SQL Source area will populate the test list:
mlist.get_test_list;
SEE
CODE DEPOT FOR FULL SCRIPTS
For more information on this topic, see the
book "Easy Oracle HTML-DB Application Express
", the best book anywhere on expert APEX
development:
APEX support:
 |
For APEX development support just call to gat an
Oracle Certified professional for all APEX development
projects. |
APEX book and code samples:
|