Saturday 25 February 2012

Dynamic Action Hide and Show Example

Recently I have seen a few people posting on the forum asking how you can hide and show items in APEX 4 and above, because of this I thought I would do a quick example.
The example is based on a simple registration form where a user can either choose to complete a private registration or register with company details.
I didn’t require the company information from the user if they was registering privately so I wanted to hide these fields.
So this is what I did, the first thing was to create my page items:

Page 102 is where I created my items and is where they will appear.  The item that determines if they are hidden or shown is the P102_REGISTRATION_TYPE which is a select list item and has the following static values:  STATIC2:Private;PRIVATE,Company;COMPANY
The next step is to create a dynamic action that will hide and show the various items.
First we have to say when it will fire

This states that when the P102_REGISTRATION_TYPE item which is the select list is changed and has a value of COMPANY then we want to the true actions to fire if not then the false actions should fire
The true and false actions can be seen below

So in the true actions I wanted to show the company items but hide the address item as I don’t need both a company and personal address.
In the false action I needed the address but nothing else
I have also checked the box when creating them that states that I want it to fire on page load.
This is a very simple way to hide and show items in a page dynamically without the page needing to be reloaded each time the select list is changed.
Previously jQuery was used to perform such actions but with the inclusion of dynamic actions in APEX 4 this became very simple using the approach above.

Monday 13 February 2012

2011 Highlights

I wanted to detail some of my highlights from 2011:
  • Graduating from Leeds Metropolitan University in July where I graduated in a first class honours degree in computing.
  • Beginning working full time for APEX_Evangelists after finishing university and after having worked part time for them previously.
  • Speaking at Kscope for the second time, it was another fantastic opportunity and experience
  • Speaking at UKOUG for the first time. Having such a large room and so many people interested in what APEX has to offer really shows the growing interest in the product
  • APEX_Evangelists also launched the APEX Quiz which can be found at as part of the PL/SQL Challenge website