Oracle APEX Template Components Reference

Oracle APEX Template Components Reference

This blog contains supplementary information to the Template Directive reference page of the Oracle APEX Universal Theme application.

The reference is extended in the following way:

Token Modifiers Reference

The Template Directive reference page provides the following documentation.

The true and false are evaluated in the following table:

However, I think the Token Modifers could be better demonstrated with an example. So here it is:

If you want to try it out for yourself, just use this link to access my Template Component Token Modifiers Reference application.

With/Apply Generator

APEX developers have to use the With/Apply syntax in the HTML Expression setting when both the following conditions are met

  • The IR Column Type is set to a Template Component plugin

  • The users wish to use the Column Filters & Sort features

To obtain the syntax required for this, developers have to work out the Plugin Attributes (preferably in Page Designer order) and use the Plugin Static Name e.g.

{with/}
  COMMENT_TEXT:=
  USER_NAME:=
  COMMENT_DATE:=
  ATTRIBUTES:=
  COMMENT_CLASS:=
  DISPLAY_AVATAR:=Y
  STYLE:=t-Comments--basic
  APPLY_THEME_COLORS:=Y
  AVATAR_TYPE:=icon
  AVATAR_IMAGE:=
  AVATAR_INITIALS:=
  AVATAR_ICON:=fa-user
  AVATAR_DESCRIPTION:=
  AVATAR_SHAPE:=t-Avatar--rounded
{apply THEME$COMMENTS/}

However, we can simply use the SQL below to extract it from the Data Dictionary.

  SELECT '<pre>{with/}<br>' ||
         LISTAGG('  ' || a.static_id || ':=' || a.default_value, '<br>') 
         WITHIN GROUP ( ORDER BY g.display_sequence NULLS FIRST, a.display_sequence ) ||
         apex_string.format('<br>{apply %0/}</\pre>', p.name) with_apply
FROM apex_appl_plugins p
JOIN apex_appl_plugin_attributes a ON p.plugin_id = a.plugin_id
LEFT JOIN apex_appl_plugin_attr_groups g ON a.attribute_group_id = g.plugin_attribute_group_id
WHERE p.application_id = :APP_ID
  AND p.plugin_type = 'Template Component'
GROUP BY p.plugin_id, p.name
ORDER BY p.name;

To use this:

  1. Edit your APEX Application containing your Template Component Plugins

  2. Create an Interactive Report with the above SQL

  3. Select the column WITH_APPLY

  4. Change the setting Escape special characters to NO

Here are some examples

You can access my Template Component With/Apply Generator app for a demonstration of how this works.

Demo app reference

ApplicationURL
Template Component Token Modifiers Referencehttps://apex.oracle.com/pls/apex/r/luf/template-component-token-reference
Template Component With/Apply Generatorhttps://apex.oracle.com/pls/apex/r/luf/with-apply-generator

What's the picture? It's a misty October sunset over Ripon. Visit Yorkshire!