Skip to main content
March 30, 2021
Question

a!safeLink not working as expected

  • March 30, 2021
  • 19 replies
  • 0 views

As per Appian 21.1 (https://docs.appian.com/suite/help/21.1/Web_Link_Component.html) now we should be able to open the link on same tab.

I tried testing this but the link opens in new tab regardless of the value that is set to the parameter openLinkIn

Test Code in 21.1.

a!sectionLayout(
   contents: {
       a!linkField(
              links: {
                   a!safeLink(
                   label: "Safe Link",
                   uri:"">https://appian.com/",
                   openLinkIn:"SAME_TAB"
                )
            }
        )
     }
)

19 replies

mikes0011
Brainy
March 30, 2021

Are you getting this behavior in the Interface Designer, or somewhere else?

Also I assume this might just be a copying error but it looks like your uri string has an extra leading ">" symbol at the moment:

March 30, 2021

Mike,

Created sample application and tested it on tempo.

Regarding ">" in uri it was added automatically when I submitted my post in community [emoticon:c4563cd7d5574777a71c318021cbbcc8].

mikes0011
Brainy
March 31, 2021

I just tried and confirm that the "SAME_TAB" functionality works as expected both on a site as well as in a Tempo report - using both a!linkField() as well as my preferred method, which is a Rich Text Display field with a link added.

If you try different browser(s) does the behavior stay the same for you?

amans0009
March 30, 2023

hi manjunathb58,
have you found the solution for this?
I am facing the same issue , in application site it is working fine but in my case in designer and in embedded interface it always opens  links in new tab.  

sandyaranik8759
February 26, 2024

[mention:b45a4f6a20b14a008e4e0ec732a8bf98:e9ed411860ed4f2ba0265705b8793d05]  We are also facing same issue. Any solution to open safelink in the  same tab from embedded interface.

mikes0011
Brainy
February 26, 2024
Any solution to open safelink in the  same tab from embedded interface

can you describe your "embedded interface" in any more detail?  If I had to guess, I'd think this feature might possibly be internally disabled in such a case, to prevent the parent interface from being clicked away from inadvertently.

srmm0001
February 26, 2024

Absolutely! Here's a shorter solution and troubleshooting steps:

Problem: The a!safeLink component isn't opening the link in the same tab, even with openLinkIn: "SAME_TAB" setting.

Potential Causes:

  • Browser settings
  • Appian Caching
  • Custom code conflicts

Troubleshooting:

  1. Try different browsers (Chrome, Firefox, Edge)
  2. Clear your browser cache.
  3. Look for any custom CSS or JavaScript that might be changing link behavior.

Workaround:

If none of the above works, temporarily use this workaround to force opening in a new tab:

Code:

a!safeLink(
label: "Safe Link",
uri: "">https://appian.com/",
openLinkIn: "SAME_TAB"
)

sandyaranik8759
February 26, 2024

[mention:cf49bdeb373e4e3bbdb7959269fae5c9:e9ed411860ed4f2ba0265705b8793d05] 

Thanks for quick response. a!link function is not available.

mikes0011
Brainy
February 26, 2024

Their response is nothing but a ChatGPT regurgitation of what's already been discussed much earlier in this thread, as Stefan pointed out, and is incorrect since the posted answer contains the nonexistent function "a!link()" where they presumably meant "a!safeLink()" - and the problem is that the question of Embedded interfaces 100% eclipses all normal troubleshooting of this issue, which is all that answer does.

I'm confused why you'd reply to this one but not reply to the followup reply I left you earlier...?