Open link in new window. Web App Builder GP Widget.

575
2
06-04-2018 01:28 PM
deleted-user-uXtLD1BYscf0
New Contributor III

I am using the WAP Developer Edition and have a geoprocessing widget (out of the box) widget that uses python and returns a hyperlink string as an output parameter.

example:

<p><a target="_blank" rel="noopener noreferrer" href="https://redirect.com"> Load into database </a></p>

The python creates this OK and the hyperlink works but the target="_blank" rel="noopener noreferrer" part of the string is ignored so it opens in the same window. I want it to always open in a new window. I confirmed this by using the "inspect" in my browser. 

 

Is the WAB doing something to remove this functionality in the hyperlink? Do I need to dive into the javascript files in the widgets\Geoprocessing folder?? If so, where!?

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Peter,

   Yes the GP widget sanitizes the text using utils.sanitizeHTML(val); Which uses 

https://code.google.com/p/google-caja/wiki/JsHtmlSanitizer 

You can find this in the resultRendererManager.js

0 Kudos
BilalSari1
New Contributor

I am also struggling with this problem. What would need to be changed in the resultRendererManager.js in order to fix this?

0 Kudos