Reputation: 11
Simplifying: Imagine you have a page in your app with 11 regions. 10 regions organized in tabs (1 region of type "Region Display Selector" with 10 sub-regions with Region Display Selector enabled) and 1 region common to all tabs (sub-region with "Region Display Selector" disabled). The common region contains an item and you want that item to appear in only 5 of the 10 tabs.
After searching and reading the documentation, I understand that APEX does not offer a native way to do this. I think using Server Side Condition you can condition whether the item is displayed on the page or not, but not in different regions selectively (please correct me if it isn't). To solve this, I have tried several options:
Option 1: Delete the common region and copy the item 5 times, each one within the region (tab) where I want it to appear.
Option 2 (it works): Assign Static Id to each region (tab) and create 10 dynamic actions, one for each region (tab):
When: "click" on "JavaScript" expression:
$("a[href='#region_static_id']");
Execute JavaScript Code:
apex.item("P23_COMMON_ITEM").hide(); // when you want this item not to be displayed in the common region
or
apex.item("P23_COMMON_ITEM").show(); // when you want this item to be shown in the common region
Both options work, but I think that both options can potentially cause performance problems, especially if, instead of only one item, there are many items or even tables instead of items. I will keep investigating. If it is possible, I would like advice from the experts.
Thanks in advance.
Upvotes: 1
Views: 2245
Reputation: 2105
You can create a new region that contains the item you want to show in 5 of 10regions. Then place that region on top of the region display selector and select some template like blank with attributes
for that region to make it borderless etc. Static id of that region and item can be used together with the JQUERY append
with some code snippet like:
$("#yourregionid").append("#youritemid");
Then as the last step, you can create a dynamic action for PAGE LOAD
and use that JQUERY code for every region you want the item to be displayed.
Note: You can execute that JQUERY code on your browser's console after you gave static id to region&item to adjust the positioning and UI.
Another Note: Since the data would only gathered once from db, I do not think it would create any performance issue that way. There are most probably other ways to achieve that but be careful with DB-Apex interaction count. In other words, creating 5 page items with the same source would work but makes it 5x more data gathering complex.
Upvotes: 1