Open Hyperlink in same window

773
3
07-11-2011 07:57 AM
GarySimpson
New Contributor
Hi

I have configured my popup info dialog to include a hyperlink in the description section. I would like to know if there is any way that the url specified can be opened in the same window? Specifying the target parameter on the anchor tag makes no difference. I am hoping to do this through configuration rather than coding. If popup's the wrong route then I'd welcome suggestions.

Basically I need people to be able to click on a polygon and then click on a hyperlink that contains the polygon's ID in the quersytring but keeps them in that window.

Thanks

Gary
Tags (2)
0 Kudos
3 Replies
SaugatJoshi
New Contributor
Hopefully this is what you are looking for

navigateToURL(new URLRequest("http://forums.arcgis.com/newreply.php?p=116147&noquote=1//www",'_self'));


"_self" specifies the current frame in the current window.

you can refer more into:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/package.html#navigateTo...
0 Kudos
GarySimpson
New Contributor
Hi Joshi

As I say, I've tried setting the anchor target parameter and I would prefer to do this through configuration rather than code. This is the popup xml:

<?xml version="1.0" ?>
<configuration>
    <title>Land Parcel</title>
    <description>
<![CDATA[Parcel ID: {Parcel_ID}<br>Sheet No: {SheetNo}<br><br><a href='http://myserver.com/flextest?Land_ID={Parcel_ID}' target='_self'>Land Referencing</a>]]>
    </description>
    <fields>
<field name="Parcel_ID" />
<field name="SheetNo" />
    </fields>
  <zoomscale>10000</zoomscale>
</configuration>

_self is ignored. Does anyone have any other suggestions.

Thanks

Gary
0 Kudos
DasaPaddock
Esri Regular Contributor
You can create a custom PopUpRendererSkin that has this line of code removed from the cleanAndSetHtmlText() function:

// add target="_blank" to all anchor tags
htmlText = htmlText.replace(/<a.*?href\s*=\s*["']([^"']*).*?>(.*?)<\/a\s*>/gi, '<a href="$1" target="_blank">$2</a>');

See:
http://help.arcgis.com/en/webapi/flex/help/index.html#/Styling_and_skinning_overview/017p0000001s000...
0 Kudos