Reputation: 373
I have a page (Page 7
) where user accounts can be created. When a user clicks the Add User
button, the user goes through a Create New User Account
flow. This flow follows 3 steps:
User Info
modal (Page 10
) displays to enter user information, on Next
save & branch to Step 2
User Roles
modal (Page 11
) displays to assign authorization role(s) to user, on Done
branch to Step 3
Page 12
) displays showing the user info and some metadata and confirmation that New User Account Created
When the user clicks the Close
button in Step 3
, I would like:
Step 3
dialog (Page 12
) to closeUser Main
, (Page 7
) to redirect/reload passing in the new username to populate the underlying reports on Page 7
for this new user account.Since there is no submit action (PROCESS
) in Step 3
- it is just presenting data - I assumed I can not use a branch like Steps 1 and 2. I need to rely on a Dynamic Action. So I tried setting up a DA triggered on the Dialog Closed
event that Executes Server-side Code
:
DECLARE
vc_Page7_URL VARCHAR2(4000);
BEGIN
vcPage7_URL := apex_page.get_url(
p_page => 7,
p_items => 'P7_USERNAME',
p_values => :P12_USERNAME
);
apex_util.redirect_url(
p_url => vc_Page7_URL
);
END;
This is not working as I expect. I'm obviously overlooking something here. I log the url in the code above to the debug stack and the url is being generated correctly, but I'm not getting a redirect to Page 7
. Any help would be appreciated.
Upvotes: 1
Views: 10855
Reputation: 373
Per @koen's recommendation, I changed the above code to be 2 TRUE actions under the Close Dialog
event that is attached to the Click
event of the Done
button:
Execute Server-side Code
:BEGIN
-- i created a hidden page item to hold the URL
:P12_REDIRECT_URL := apex_page.get_url(
p_page => 7,
p_items => 'P7_USERNAME',
p_values => :P12_USERNAME
);
END;
Execute JavaScript Code
:let url = $v("P12_REDIRECT_URL");
apex.navigation.redirect(url);
Upvotes: 2
Reputation: 18665
I'm not sure that will ever work - you can't do a redirect from within pl/sql in a dynamic action process. The pl/sql code is running in the background and cannot redirect the page. There are 2 options
Upvotes: 2