Friday, August 18, 2017

APEX Interactive Grids - what I've learned so far

My latest project has been building new pages on APEX 5.1, and quite a few of them have involved the new Interactive Grids (IGs).  I've learned I few things about them in the process, which I thought I'd record here both for my own benefit and in case it helps others.

They are addictive

I've seen a video of a David Peake presentation about IGs where he warns that developers will be tempted to overuse them.  It's true: once you've built a couple of IGs you are inclined to want to use them on every page instead of showing a report with an edit link.  They are very slick and modern in appearance.  But it's important to consider the users and whether the IG is the best interface for what they need to do.

They are very new

Like anything very new, they having teething troubles.  I've raised a number of issues on the Oracle APEX forum where things don't seem to work quite as they I would expect, or found issues that others have already raised.  These include:

A common thread here is that these questions often don't get answered.  I think this is because there is only one person who might know the answer, and he is no doubt a very busy man!

Being new they are also somewhat scant on documentation.

They are complex to configure

Out of the box you can configure a few properties of an IG via the APEX Builder such as:
  • Grid is editable or not
  • Insert/Update/Delete operations allowed or not
  • Toolbar is shown or not
  • Save and Reset buttons are shown or not
  • ... and several other things
However, they are nowhere near as declaratively configurable as Interactive Reports, which allows you to switch off individual features of the Toolbar its Actions list via property settings.  If you want to remove unwanted actions from an IG's toolbar (other than Save and Reset)  then you have to write some moderately complex Javascript that requires a knowledge of the IG's underlying architecture.  This is currently undocumented, but luckily John Snyders (who built them) has written a great series of blog posts about how to hack IGs that is indispensable if you need to make such changes.  I also found this blog post by SLino invaluable when wanting to drastically simplify an IGs config, and Explorer's review of IGs is a great way to get an overview of what is involved in developing with them.

I think that this complexity of configuration rather goes against the APEX principle of "low code", and very much hope that a lot more declarative control will be added in future versions of APEX.  But I appreciate that's a pretty tall order and Rome wasn't built in a day!

They can be slow to load

It seems that a lot of work goes on in Javascript when you load a page that has one or more IGs. On a modern browser like Chrome this isn't very noticeable and the page will be ready to use within a second or so even with a few IGs.  But IE11 (which is still the official browser for my users :-( ) takes about 5 seconds per IG, so a page with master-detail-detail IGs might take 15 seconds to initialise after page load.  I have heard that there will be some performance improvements in APEX 5.1.3, so look forward to seeing that.

Conclusions (TL;DR)

Interactive Grids are a great and powerful addition to the APEX toolkit, a vast improvement over the old tabular forms.  They should be used where they really add value, and not overused.  Being very new, they have a few issues, are not well-documented (compared to the rest of APEX), and require some quite advanced coding (and a lot of Googling) to configure if the default behaviour is not what you need.  I'm sure that by the time APEX 6.0 comes out they will be even better, and much easier to configure!