
What this book covers
Chapter 1, Setting up an Oracle APEX and Ext JS Environment, takes you through the process of setting up a productive development environment for both Oracle Application Express (APEX) and Ext JS options for setting up a local installation, where you have direct access to the database. Web servers are covered, including the Oracle HTTP Server, the Embedded PL/SQL Gateway, and the Oracle APEX Listener. Setting up on a hosted environment, where you only have web browser access, is also covered.
Automating your build processes is a great way to improve productivity. We set up a source code repository, integrating an automated backup and commit process as the first step to aid your development. A number of other automation opportunities are also discussed. By the end of the chapter, you will be fully set up and ready to code.
Chapter 2, Getting Acquainted with Ext, introduces the Ext JS API, spending time familiarizing you with some of the functionality Ext JS provides for manipulating the Document Object Model (DOM). Topics covered include how to build a standalone testing page, cross-browser element manipulation using the Ext.Element
class, DOM traversal using the Ext.DomQuery
class, and defining event handlers to add interactivity to your web pages.
Many of the examples are run using the Mozilla Firefox browser with the Firebug Plug-in. Firebug provides fantastic debugging tools for inspecting and editing the HTML, DOM, JavaScript, and CSS components that make up a web page. It also includes a JavaScript console, allowing you to inspect JavaScript errors and execute JavaScript code. This chapter shows you how to make use of the Firebug command-line console for quick prototyping and testing.
Chapter 3, Building a Ext JS Theme into APEX, provides a background on APEX themes and how to create a theme from scratch. A page template is developed based on the Ext.Viewport
component, starting with a standalone prototype, before integrating it into an APEX page template.
Applying JavaScript DOM manipulation to page elements can result in input items appearing outside the form element, with some very nasty side effects. This chapter demonstrates the issue and shows the consequences, before providing a solution to ensure that this never happens to you.
Chapter 4, Ext Themed Regions, Labels, and Lists, develops templates for regions, labels, and lists using Ext JS components. Static region templates based on Ext.Panel
are created, and then collapsible versions are added with a few lines of JavaScript to the templates. Inline error messages for labels can cause issues with page layout, so you are shown how Ext.QuickTips
can be used to neatly solve the problem. Simple list templates are developed before a more complex example implementing a TreePanel is developed, showing how templates can also be used to produce JavaScript code and JSON objects, and not just HTML.
Chapter 5, Ext Themed Buttons, Popups, Calendars, and Reports, develops templates for the remaining template types: Buttons, popup list of values, breadcrumbs, calendars, and reports. The Ext JS Grid component is one of the most advanced and widely used components in the library. For the report template, you will learn how to "fake it", using the built-in functionality of an APEX Classic report and combining it with some CSS, so it looks like a read-only Ext JS Grid with AJAX paging.
Once the template types are completed, you are shown how to remove unused templates quickly using the APEXExportSplitter
Java class, before publishing the theme.
Chapter 6, Adding Ext Layout Elements, offers a number of "low-hanging fruit" solutions, providing you with functionality that can significantly and broadly improve parts of your application with minimal implementation effort.
Some of the solutions improve existing HTML components, such as automatically replacing the APEX Classic DatePicker with the advanced Ext.DatePicker
component, a solution to make all text areas resizable, or better still, auto-sizing so that text areas automatically grow as you type. Select lists are automatically transformed to combo boxes allowing lists to filter data progressively as more keys are typed. Completely new functionality using Ext JS components includes a tab panel
template using APEX 4.0 nested sub regions, along with a toolbar and menu template.
Chapter 7, Working with Plug-ins and Dynamic Actions, introduces Plug-ins and Dynamic Actions, two of the most exciting new features in APEX 4.0 for developers. For the first time, you have the ability to add custom "widgets" easily and directly into APEX that can be used declaratively in the same way as native APEX components. Plug-ins and Dynamic Actions are supported with back-end integration, allowing developers to make use of APEX provided PL/SQL APIs to simplify component development.
APEX 4.0 introduced the Number Field as a new item type, allowing you to configure number range checks by optionally specifying minimum and maximum value attributes. This chapter provides a gentle introduction to the Plug-ins and Dynamic Actions, building a better Number Field than the native APEX item type.
Chapter 8, Data Stores, AJAX-enabled Plug-ins, and Dynamic Actions, continues working with Plug-ins, creating a complex ComboBox Plug-in, dealing with more advanced Plug-in concepts, including AJAX processing and interacting with Dynamic Actions.
ComboBoxes use data stores, providing the Ext JS framework with the ability to store data on the client browser, acting much as an in-memory database. This makes the process of integrating AJAX functionality into Plug-ins far simpler, because AJAX processes are focused on just passing data between the client browser and the database. The Ext components already contain the client-side functionality to update the display.
For the ComboBox, you are taken through the process of modifying the Ext JS components to work within the Dynamic Actions framework.
Chapter 9, Getting Interactive with GridPanels, integrates the Ext JS GridPanel
, one of the most powerful and widely used components in Ext JS, into APEX. Taking the approach of extending existing functionality in APEX, the GridPanel is integrated as a Plug-in for classic reports.
The GridPanel Plug-in includes column management features including sorting, resizing, drag-and-drop column reordering, and show/hide columns. APEX functionality is combined to make the GridPanel stateful, saving user settings back into APEX preferences.
Chapter 10, IFrame Tabs, Panels, and Popup Windows, shows you how iFrames can completely transform the way your APEX applications work. This chapter looks at using iFrames in three different ways: Embedding other pages within a page using iFramed Panels, making modal popup windows, and creating a tabbed document interface, allowing users to easily switch backward and forward between pages without opening multiple browser tabs.
Chapter 11, Performance Tuning your JavaScript, rounds out the book by looking at performance tuning your JavaScript. Topics look at ways of keeping JavaScript lightweight, using recommendations from Yahoo! and Google add-ons for Firebug.
Reducing file size at the source is also covered, learning how to use JSBuilder2 to build a customized lighter version of the Ext Library with unused components removed. JSBuilder2 is also used to combine and minify custom application JavaScript.