Luke G
Luke G

Reputation: 1747

Oracle APEX - show/hide regions

There are two regions (R1 an d R2) set up on a single page (P1). I would like to show and hide regions based on value of one of the fields from page P1.

Could you please point me in the right direction as I am new to APEX and I feel bit lost with all these configuration options.

Thanks, Luke

Upvotes: 2

Views: 23638

Answers (1)

Jeffrey Kemp
Jeffrey Kemp

Reputation: 60312

The answer depends on whether the field on P1 can be changed dynamically by the user, and if you want the regions to hide/show as the field is changed; or if the field is static (i.e. set once at page load time) and so we only need to show/hide the regions when the page is first loaded.

  1. If the field is static, you can add a Condition to each of the page regions, e.g. set the region Condition to Value of Item / Column in Expression 1 = Expression 2, put the item name (e.g. P1_MY_ITEM) in Expression 1, and the value to compare it to in Expression 2 (e.g. Y). On the other region, set the region Condition to Value of Item / Column in Expression 1 != Expression 2 and set Expression 1 and Expression 2 to the same. (Note: this does not work if the item can be NULL - in which case you will need to use a variation of this to account for NULLs).
  2. If the field is dynamic, you can add a Dynamic Action (Apex 4.0+) to the field which will fire onChange - set the condition for the dynamic action to something like :P1_MY_ITEM='Y'. Set the True action to show one region and hide the other region. Set the False action to do the opposite (hide the first region and show the other).

Upvotes: 4

Related Questions