How to Redirect URL in UI page

MohanambalN
Tera Contributor

Hi All,

 

I have a requirement where I need to redirect to the portal page from UI page.

Tried with "gs.setRedirect(url);" But it didn't help much.

 

Also, I need to hide one button in UI Page. 

Please advise on this.

 

Thanks.

1 REPLY 1

Bhavya11
Kilo Patron

Hi @MohanambalN ,

 

can you try something like this 

 

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

  <h1>My UI Page</h1>
<button id="myButton" onclick="redirectToPortal()">Click Me to Redirect</button>

<script>
  function redirectToPortal() {
    window.location.href = "/sp?id=sc_category"; // Replace 'your_portal_page' with the actual page ID or URL
  }
</script>



</j:jelly>

 

 

 

Please mark helpful & correct answer if it's really worthy for you.

 

 

Thanks,

BK