Inside of Information Delivery Portal via a Web URL Portlet. I’m running into a problem where one of my forms has a Refresh button and a View All button. The Refresh button reloads the same page based on a dropdown selection. The View All button takes the user to another page and should pass the parameter of the updated dropdown, however the user has to hit the refresh button to update the parameter. The reason is that the dropdown only saves its value on post back. The original author of the page used one form object per button. I think I could solve the issue using one form and buttons that have syntax like.
PUT "<button onclick=""window.location.href=""https://serverName/"@;
PUT "SASPortal/Director?_directive="@;
PUT "STPRun&_action=execute%nrstr(&_program)=/Reports/Research Dashboard/Monthly Expense Report"@;
PUT "%nrstr(&save_REPORT_MONTH=)&save_REPORT_MONTH""""/>View All Reports</button>";
Oddly this syntax calls the second page without the updated dropdown value. All of the documentation I am looking at for standard HTML states this should work. Am I missing something obvious here? Is there a simpler way to do this?
Added to Dropdowns:
onchange='this.form.submit()
If you did need to redirect for some reason _action=execute skips the parameters.
I’m looking at redirect options. Once I figure this out I’ll add logic to reload the page and do this under a condition if a button is pressed. It seems the redirect syntax is slight different when using SAS.
%macro javaScriptFunctions;
data _null_ ;
file _webout ;
put 'script type="text/JavaScript"' ;
put "function viewAll() {";
put "var newPage = window.location.href + ""servername/"@;
put "SASPortal/Director?_directive=STPRun&_action=execute&_program=/Reports/Research Dashboard/Monthly Expense Report"@;
put "&ACCOUNT_INDEX=ALL&save_REPORT_YEAR=2015&save_REPORT_MONTH=5"";";
put "window.location.replace(newPage);";
put "}";
put "</script>";
run ;
%mend;
%javaScriptFunctions;
this results in parameter error
Invalid _action value: execute/Reports/reportName=/Reports/reportName2.
BTW, there is a major bug in the new forum where you can't post HTML.
After changing my spaces to + I got the error
Invalid _action value: one step closer.
This article seems relivent.
I followed the article http://support.sas.com/kb/20/154.html. I used the same syntax on the redirect I receive a prompt screen filled with the prompts that I sent appended with the & signs. After I click run my stored process runs. How do I skip the prompt screen?
Added to Dropdowns:
onchange='this.form.submit()
If you did need to redirect for some reason _action=execute skips the parameters.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.