Databases Reference
In-Depth Information
Figure 4-21. The new button in action
How It Works
To APEX, a button may not necessarily be a button, and a textbox not necessarily a textbox. Zen-speak
aside, how APEX represents each form control is entirely customizable by the developer. For instance,
APEX ships with the following default template for a button:
<button value="#LABEL#" onclick="#LINK#;" class="button-gray" type="button">
<span>#LABEL#</span>
</button>
But the fact that APEX exposes this template to you and lets you modify it means that you can, for
instance, replace the previous HTML with something else entirely. Once you do that, every time an APEX
application needs to render a button, it would render your HTML.
This flexibility means that you can, for instance, to change all buttons in your form to image buttons
simply by changing the button template. Or, in the case of this recipe, add additional functionality not
present in the default control.
4-6. Creating Reusable Code Snippets
Problem
You have been tasked by your bosses to create an area in *all* your application forms to display the
current system date in this fashion: " The date today is XXXXXXXX. " You know you can write a simple
one-line PL/SQL to generate this label inside every form, but knowing your bosses better, you know
they're going to change their finicky minds the next day on how the date is presented. With this in mind,
you need a way to centralize the point of change in your application, so that when you change the text in
one location, it will automatically take effect in all your application forms.
 
Search WWH ::




Custom Search