Wednesday, February 13, 2008

Region Attributes Feature in APEX 3.1

Patrick Wolf blogged about a new feature of APEX 3.1 called Region Attributes.  I remember trying to get this in to HTML DB 1.6, back when I was the Product Manager in 2003!

Basically, this feature enables you to specify a parameter at the region level which, in turn, will be placed where the #REGION_ATTRIBUTE# tag is located in the template itself.

This feature will definitely cut down on the number of templates required for an application, as going with Patrick's example, the width of a region template can be defined differently for each instantiation of that template.

I just ran into this issue with a client and had to use a slight workaround.  We have an application with 7 tabs - each of which is a different function.  We wanted to indicate which function a user was performing by placing the corresponding icon in the region itself.  I did not want to have to create 7 almost identical region templates, as that would be too cumbersome to manage.

So, I simply created an Application Item called G_ICON, and then referred to that in my region template using the following notation: &G_ICON.

On each page, I created a Before Header computation that sets the value of G_ICON.  Thus, as the user moves from tab to tab, they will see a different icon, and I only have to manage the contents of a single region template.

This method will be unnecessary once APEX 3.1 is released, but if you do have the need for a very dynamic region or other template, it may come in handy today and in the future.

1 comment:

Joel R. Kallman said...

>> I remember trying to get this in to HTML DB 1.6

You just didn't offer enough bottles of Maker's Mark as your bribe. ;)