BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DavidPhillips2
Rhodochrosite | Level 12

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?

1 ACCEPTED SOLUTION

Accepted Solutions
DavidPhillips2
Rhodochrosite | Level 12

Added to Dropdowns:

onchange='this.form.submit()

 

If you did need to redirect for some reason _action=execute skips the parameters.

View solution in original post

4 REPLIES 4
DavidPhillips2
Rhodochrosite | Level 12

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.

DavidPhillips2
Rhodochrosite | Level 12

After changing my spaces to + I got the error 

Invalid _action value:   one step closer.

 

This article seems relivent.

 

http://support.sas.com/kb/20/154

DavidPhillips2
Rhodochrosite | Level 12

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?

DavidPhillips2
Rhodochrosite | Level 12

Added to Dropdowns:

onchange='this.form.submit()

 

If you did need to redirect for some reason _action=execute skips the parameters.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1320 views
  • 0 likes
  • 1 in conversation