<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Problem with Hyperlinks in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/problem-with-hyperlinks/m-p/252507#M6007</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to get a Data Grid&amp;nbsp; to pop up (or it could remain static) when a user clicks or mouses over a line feature. I think this part is manageable. However, I want in the data grid, a field for hyperlinks that the user can click to view a .pdf file. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is that my hyperlink field values do not contain the full paths. On the current .net site, we have the first half written in code and this is concatenated with the last half that remained in the field. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to do this in Flex? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any help or advice you all can give me will be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Josh Calhoun&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Chattanooga GIS&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Jul 2010 15:34:33 GMT</pubDate>
    <dc:creator>Joshuacalhoun</dc:creator>
    <dc:date>2010-07-20T15:34:33Z</dc:date>
    <item>
      <title>Problem with Hyperlinks</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/problem-with-hyperlinks/m-p/252507#M6007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to get a Data Grid&amp;nbsp; to pop up (or it could remain static) when a user clicks or mouses over a line feature. I think this part is manageable. However, I want in the data grid, a field for hyperlinks that the user can click to view a .pdf file. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is that my hyperlink field values do not contain the full paths. On the current .net site, we have the first half written in code and this is concatenated with the last half that remained in the field. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to do this in Flex? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any help or advice you all can give me will be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Josh Calhoun&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Chattanooga GIS&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jul 2010 15:34:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/problem-with-hyperlinks/m-p/252507#M6007</guid>
      <dc:creator>Joshuacalhoun</dc:creator>
      <dc:date>2010-07-20T15:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Hyperlinks</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/problem-with-hyperlinks/m-p/252508#M6008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you want a clickable link, you'll want to set up the labelFunction of the DataGrid, which would look something like this&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;protected function formatURL(item:Object, column:DataGridColumn):String {
column.itemRenderer = null;
if (column.dataField == "URLData" ) {
 column.itemRenderer = new ClassFactory(UrlLinkButton);
 return item.URLData;
}
else if (column.dataField == "Name") // set up checks for other field names
 return item.Name;
else
 return "ERR: No Field name defined";
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With an ItemRenderer for your field that could look like this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;mx:LinkButton xmlns:fx="http://ns.adobe.com/mxml/2009"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:s="library://ns.adobe.com/flex/spark"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:mx="library://ns.adobe.com/flex/mx"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fontWeight="bold"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; color="#0000FF"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label="{data.URLData}"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; click="openURL()"&amp;gt;
 &amp;lt;fx:Script&amp;gt;
&amp;nbsp; &amp;lt;![CDATA[
&amp;nbsp;&amp;nbsp; /**
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Function that will parse current date and given URL info into a url string to be opened in a new page.
&amp;nbsp;&amp;nbsp;&amp;nbsp; **/
&amp;nbsp;&amp;nbsp; protected function openURL():void {
&amp;nbsp;&amp;nbsp;&amp;nbsp; trace("button clicked, attempt to parse to URL");
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (data.URLData) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // concatenate url string
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var url:String = "url information" + data.URLData + "maybe more url information";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace("send drawing url request");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; navigateToURL(new URLRequest(url));
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; ]]&amp;gt;
 &amp;lt;/fx:Script&amp;gt;
 &amp;lt;fx:Declarations&amp;gt;
&amp;nbsp; &amp;lt;!-- Place non-visual elements (e.g., services, value objects) here --&amp;gt;
 &amp;lt;/fx:Declarations&amp;gt;
&amp;lt;/mx:LinkButton&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This way, the URL opens only if they click in that field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course you could bypass the ItemRenderer and use the openURL() on an ItemClickEvent if you don't mind that the URL will open when they click the row in the DataGrid.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:30:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/problem-with-hyperlinks/m-p/252508#M6008</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-12-11T12:30:48Z</dc:date>
    </item>
  </channel>
</rss>

