Trigger ui page from another ui page through hyperlink

Rj27
Mega Guru

Hi,
Can i trigger a ui page from another ui page ?
I have an existing ui page : Page 1
In my new ui page i need to display a hyperlink on click of which it should redirect to page 1. 

1 ACCEPTED SOLUTION

@Rj27 

Now it is better.

UI Action

find_real_file.png

UI Page

Use this script in the HTML/XML of your first UI Page.

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

	<a onClick="openOtherUIPage()">Open Other UI Page</a>	
	
</j:jelly>

Use this in the Client Script of your first UI Page.

function openOtherUIPage() {

        var gdw = new GlideDialogWindow('<other_ui_page_name>');
        gdw.setSize(550, 550);
        gdw.render();
}

See the below image for reference.

find_real_file.png

Results

find_real_file.png

 

find_real_file.png

View solution in original post

13 REPLIES 13

Here is my setup:
UI Action :

function view() {
    var gdw = new GlideDialogWindow('Redirect');
   gdw.setSize(550, 550);
    gdw.render();
}

 

ui Page 1 : Name: Redirect: The content of this ui page is supposed t have a hyper link, on click of which another existing ui page should open . The sys id passsed is the id of second ui page.

<g:ui_form>
<g:evaluate var="jvar_sysId" expression="RP.getWindowProperties().get('sysparm_sys_id')"/>
<p>test</p>
<a href="/ui_page.do?sys_id=5845a47c9702111020a277d71153af7a"> click here </a>
</g:ui_form>

UI Page 2 :

<g:ui_form>
<p>test123</p>
</g:ui_form>


When the link ('Click here' text)in page 1 is clicked, ui page is called but it's opening in full screen. 
UI Page 1 :
find_real_file.png

UI Page 2 (expected when clicked from the hyperlink):

find_real_file.png

Actual display when hyperlink is clicked:
find_real_file.png



@Rj27 

Now it is better.

UI Action

find_real_file.png

UI Page

Use this script in the HTML/XML of your first UI Page.

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

	<a onClick="openOtherUIPage()">Open Other UI Page</a>	
	
</j:jelly>

Use this in the Client Script of your first UI Page.

function openOtherUIPage() {

        var gdw = new GlideDialogWindow('<other_ui_page_name>');
        gdw.setSize(550, 550);
        gdw.render();
}

See the below image for reference.

find_real_file.png

Results

find_real_file.png

 

find_real_file.png

Mahendra RC
Mega Sage

Hello @Rj27 

You can use something like below HTML code on your ui page. I have hardcoded the URL on incident record to redirect once user click on Click Here.

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
	<g:evaluate var="jvar_sysid" expression="RP.getWindowProperties().get('sys_id')"/>
	<g:ui_form>
		<p>
			<a href="/incident.do?sys_id=e295b90797b151104cadfb000153af99">Click Here </a> 
		</p>
	</g:ui_form>
</j:jelly>

If my answer helped you in any way then please do mark it as helpful. If it answered your question then please mark it correct and helpful. This will help others with similar issue to find the correct answer.

Thanks

Hello,

I tried this already :

<g:ui_form>
<g:evaluate var="jvar_sysId" expression="RP.getWindowProperties().get('sysparm_sys_id')"/>
<p>test</p>
<a href="ui_page.do?sys_id=5845a47c9702111020a277d71153af7a"> click here </a>
</g:ui_form>

The sys id mentioned above is the id of the second ui page. This is opening a new tab. I want to display it as ui page of specified size..