UI Page redirecting to new Record

puneetgoels1
Tera Guru

I have made a ui page with a button, which is being used by a service catalog item. UI page is made visible on one of the catalog tasks. On click of button glideajax is call to do some functionality and it is working fine. But the issue is once that activity is complete. page is redirected to a new record catalog task page. How can it be restricted that the page remain at the same catalog task or if not it redirects back to that catalog task.

 

HTML

 

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

	<button type="submit" onclick="LaunchAuto();"> Launch Auto</button>
</j:jelly>
 

Client Script

function LaunchAuto() {
	
	try{
		
		alert('Auto Request has been raised ');
		
	}
	catch(err)
	{
		alert(err);
	}
	
	
	
}

 

No Processing script

1 ACCEPTED SOLUTION

puneetgoels1
Tera Guru

I found the issue. I was because of missing type  type="button"

<button type="button" onclick="launchAuto();"> Launch Auto</button>

 

I placed it and it worked

View solution in original post

13 REPLIES 13

tried putting 

response.sendRedirect(gs.getSession().getUrlOnStack());  

 

but still it is redirecting to new page

puneetgoels1
Tera Guru

I found the issue. I was because of missing type  type="button"

<button type="button" onclick="launchAuto();"> Launch Auto</button>

 

I placed it and it worked

Good news, please mark your answer as correct so that it can help others.

saichary
Tera Contributor

If you use type='button' UI page is not closing in workspace