3

Easy Accordion – APEX Region Template

Although it’s tempting to create a plugin for every new widget you want to introduce into APEX, sometimes it’s just as easy to create a new template and add the functionality within it. Patrick Wolf provided a simple way of creating a jQuery UI accordion using a region template in the following forum thread

The same technique can be applied for the jQuery Easy Accordion written by Andrea Cima Serniotti

Please note: the following is copied pretty much verbatim from Patricks procedure which was pretty clear and concise, all that I’ve changed is the template code.

  1. Download easyaccordion.zip and unzip under #IMAGE_PREFIX#libraries
  2. (Optional) Modify easyaccordion.css easy-accordion-style1,easy-accordion-style2,easy-accordion-style3 CSS to meet your own requirements
  3. Create a new template of type “Region” (Shared Components\Templates)
    1. create one from scratch
    2. Name: jQuery Easy Accordion
    3. Template Class: e.g. Custom 3
    4. Template:
      <div id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>
      
      #BODY##SUB_REGION_HEADERS##SUB_REGIONS#
      </div>
    5. Sub Regions – Template:
      #SUB_REGION_TITLE#
      #SUB_REGION#
  4. On the page where you want to have an Accordion, add a new “HTML” region which acts as the container for the “accordion”. Set the region template to your new “jQuery Easy Accordion” template and make sure you set in the “Region Attributes” the correct class setting for your accordion style e.g. class=”easy-accordion-style1″
  5. Create as many sub regions (that are the actual accordion slices). It’s just important that you set the “Parent Region” to your container region you just created before. As region template I would pick “No Template” or any other template you want to have.


Now the above works just fine, but if you need to customize the parameters for several different pages in your application then you are going to have a problem. To workaround this here are two potential options for changing the template:

  1. We use an existing page/application item and use the substitution syntax e.g.
    <div id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>
    
    #BODY##SUB_REGION_HEADERS##SUB_REGIONS#
    </div>

    and we would set session state for the item on page load using a PLSQL page process before/after header e.g.

    :P1_ITEM := '{
       autoStart: true,
       slideInterval: 5000,
       slideNum: false
    }';
    
  2. Or we use one of the available template substitution strings e.g. #REGION_ATTRIBUTES#
    #BODY##SUB_REGION_HEADERS##SUB_REGIONS#

    Note: I have defined the class setting using the region title. So in your parent container region title you would specify the appropriate CSS class e.g. easy-accordion-style1. Then within the region attributes for your parent container region you would specify the JSON object e.g. { autoStart: true, slideInterval: 5000, slideNum: false }

Here’s a demo of the accordion in action.

0

Ext.tree.TreePanel – Server Side Search **NEW**

One of the great things about the APEX plugin – Ext.tree.TreePanel – is that you can either load the tree in one AJAX call on page load or in multiple calls when each node is expanded the direct children are returned. In addition to the expand of each node via AJAX, you can also control the number of levels to fetch, whether its 1 (the direct children), 2, 3, 4 or more you have the flexibility to choose. The other great feature is the ability to search the tree and still retain the parent level hierarchy for child nodes which match the search criteria e.g.

However when using both these features in combination, there was a performance problem in the initial plugin release. This was due to the search being performed on the client side. The entire tree would be expanded in order to locate the search results. In cases of large tree’s this could cause significant number of AJAX processes to be fired and place an overhead on the database. In order to combat this problem I have introduced a new server side search feature which will perform the search on the database and return the results in a single AJAX call. The results mimic the client side search by returning the parent level hierarchy for child nodes which match the search criteria.

This serverside search results in optimal performance and means that large tree structures of 10000+ records are now easily searchable without having to load the entire tree structure on the client, which most other Ext implementations are prone to. This new feature is automatically enabled when expanding each node via AJAX is enabled.

Now here’s the really good news… Until the end of May I’m offering a “FREE plugin license” for the Ext tree or Multifile upload plugin when 2+ development services/support are purchased. These 2+ days can be used from anything from training/mentoring on APEX/PLSQL/Javascript/CSS, design advice, troubleshooting, environment setup, security reviews, plugin development, prototype builds, theme design, etc.

The great news is that the days do not have to be used in full, you can decide to schedule it in sessions as little as 30 mins depending upon your requirement. But remember this offer is limited and only until the end of May, so don’t delay.

20

APEX Plugin – Ext.tree.TreePanel (RC1 Release)

I’m very proud to announce the first public release of a new commercial APEX plugin based on the tree widget from the Ext JS library developed by Sencha. It’s jam-packed full of functionality and customisation ability. It’s simple to use with predefined defaults “Out of the Box”, but also allows you to use every config parameter, method, and event documented in the Ext JS API.

APEX Plugin - Ext.tree.TreePanel

APEX Plugin - Ext.tree.TreePanel

Here’s a list of the plugin’s features:

  • AJAX enabled with the choice of loading the entire tree in one call or on node by node or X many levels expanding ability
  • Search: Dynamic filtering of the tree contents
  • Customisable Expand & Collapse & Refresh buttons
  • Tree drill down capability
  • Drag & Drop Reordering Support
  • Tree Label Editing
  • Checkbox Nodes with state saving using an existing APEX item
  • Context Menu with complex object Support (from a single SQL Query)
  • Cookie based state saving for expanded nodes.
  • Order by “Display Sequence” support
  • Fully integrated into dynamic actions. Bind click, drag & drop, edit complete, expand, collapse, context menu selection etc. events
  • In it’s basic form opens URL targets
  • Tree config is fully customizable with application level defaults
  • Support for node by node custom config, e.g. enableDrag = false
  • Full support for replacing substitution strings in both config & data
  • Custom icon support
  • Help Text/Quick Tip support
  • Supports unlimited tree’s on a single page
  • Theme changing support

and here’s where you can find the documentation, demo’s, and download.

I’m hoping to get some feedback and enhancement requests over the next few weeks before releasing the final production version towards the end of May. One point to note: it does require the purchase of a plugin license and that you also hold/purchase a license from Sencha to use the Ext JS library; but before this changes your mind you may want to consider the following:

  • It’s simple to use. All you need to define is a simple flat SQL query, no CONNECT BY needed.
  • It will save you time every single time. You can create an AJAX enabled tree with context menu support in a couple of minutes. It’s arguably the fastest way to create a complex Ext JS tree end to end, thanks to the RAD architecture of APEX.
  • With AJAX node by node expanding capability you can create a tree based on large datasets, it’s been tested on 20,000+ record hierarchical tree’s.
  • It provides feature rich options not available in the standard APEX jsTree. Such as checkboxes, label editing, drag & drop reordering, AJAX fetching by X many levels, searching, the list goes on… all within the one plugin.
  • It’s integrated into Dynamic Actions, which means it’s easy to bind events and actions within the actual APEX framework/IDE. Refreshing standard APEX reports via AJAX on different tree events is simple.
  • It’s fully supported, will stay actively developed, and you can file enhancement requests.
  • Once you choose Ext JS you’re opening up endless of possibilities for developing feature rich applications, whilst safely knowing you can still use standard APEX components and jQuery. It’s the best of both worlds!
  • Ext JS provides cross browser support, it’s built on Web Standards, which translates into reduced maintenance & troubleshooting.
  • This is the first of many plugins in the pipeline. The license revenue will fund future plugin development, so your support is essential. I’m passionate about bringing as much Ext functionality to APEX as possible in a future proof, maintainable approach so “we all” can build amazing web applications, amazingly fast.

Test it out, I’m positive you won’t be disappointed….. and if you are let me know, I want your feedback :) good or bad.

Pages ... 1 2 3 4 5 6 7 8 9