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

Syvo
Mega Guru

Hi,

Please give some details about your ui page.
My first wild guess is that you have a <g:ui_form> element in your page. If your action doesn't use a processing script, but just makes an ajax call and closes, you can remove the form.

HTH,
Sylvain

puneetgoels1
Tera Guru

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

Hi, Remove the "type='submit'" part and try again.

No impact. Still the same issue