#44 Dynamic link tabs in Oracle APEX
Hi all,
For my own application, I have build a page with hero and a tab region. The tabs(2) shows a classic report with data. In the hero region I placed a button. So I was wondering how to create a dyncamic link. For example:
For my own application, I have build a page with hero and a tab region. The tabs(2) shows a classic report with data. In the hero region I placed a button. So I was wondering how to create a dyncamic link. For example:
- When tab A is active, the button must open modal A.
- When tab B is active, the button must open modal B.
Steps:
- Create a dynamic action
- Create action; Execute Javascript code
- Create a AJAX Callback process
Explanation:
- Create a dynamic action
Choose a click event and choose the button as selector. - Create action; Execute Javascript code
The Javascript code will look wich tab is active and open the modal with the apex.navigation API - Create a AJAX callback process
This process creates the dynamic links and puts it into a JSON array.
var isActive = $(".a-Tabs-panel.a-Tabs-element-selected").attr("data-label");
if (isActive === 'TAB A')
{
apex.server.process ( "URL", {
x01: 'A'
}, {
success: function(Data)
{
apex.navigation.redirect(Data);
}
});
}
else
{
apex.server.process ( "URL", {
x01: 'B'
}, {
success: function(Data)
{
apex.navigation.redirect(Data);
}
});
};
declare
l_url varchar2(500);
begin
if apex_application.g_x01 = 'A'
then
l_url := apex_util.prepare_url(p_url => 'f?p='||v('APP_ID')||':3:'||v('APP_SESSION')||'::NO:3'
,p_checksum_type => 'SESSION');
else
l_url := apex_util.prepare_url(p_url => 'f?p='||v('APP_ID')||':4:'||v('APP_SESSION')||'::NO:4'
,p_checksum_type => 'SESSION’):
end if;
apex_json.open_array;
apex_json.write(l_url);
apex_json.close_array
end;
See you next time!
Comments
Post a Comment