Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
multiple hyper links in table detail row
rajkishore
<p>Hi,</p>
<p> </p>
<p>i was trying to create hyper links using the script.though i was able to create due to the "this.action" it is setting all string to one hyper link on the on render method. How can i set a multiple hyperlinks for a comma separated string.</p>
<p> </p>
<p>for example in the above attached example report design "CUST" column has comma separated data as string, i want to split the string and create a hyper link of each string.</p>
<p> </p>
<p> </p>
<p>i am using the ihub3.1 and designer 4.4</p>
<p> </p>
<p>Regards</p>
<p>Kishore G</p>
<p> </p>
<p> </p>
Find more posts tagged with
Comments
Matthew L.
<p>This can be accomplished using a text element and some JavaScript (See attached example)</p>
<pre class="_prettyXprint _lang-html">
<!--
//Please note that all custom code received from Actuate Support is officially untested and unsupported.
//This is meant for guidance purposes only and should not be implemented in a production environment without proper testing.
//
//The following example takes a row value and splits it into an array (csvList).
//Then creates an href based on the values in the array and rejoins the href array into an HTML element.
//
-->
<div id="tmpRefDiv"></div> <!--Reference div for output display -->
<script type="text/javascript">
var csvList = "<VALUE-OF>row["CUST"]</VALUE-OF>"; //Get row value
var csvList = csvList.split(","); //Split string into an array
for (var i=0;i<=(csvList.length-1);i++){ //Loop through array
csvList[i] = "<a href=\"../servicerequests/" + csvList[i] + "\" target=\"_blank\">" + csvList[i] + "</a>"; //Convert value into href link
}
var div = document.getElementById("tmpRefDiv"); //Get reference div tag
div.innerHTML = csvList.join(", "); //Send new converted href string to the div tag
if(!window.a){a=window.a=0;}else{a=window.a;} //Set window.a if not previously set
a++; window.a = a; //Increment a and update window.a value
div.setAttribute("id", "csvList_" + a); //Increment the div tag so the next loop doesnt effect this current one
</script>
</pre>
rajkishore
<p>Thanks Matthew. I will enhance this as required.</p>