stay on same page after submission on UI page

IamAmolB
Tera Guru

I have created one UI page. after submission of UI page i want to stay on the same page from where i trigger the UI page.

Do we have any code.?

I have putted one code in processing script of UI page as below but not working.

var redirect = Packages.com.glide.sys.GlideSession.get().getStack().bottom();

response.sendRedirect(redirect)

Do we have any other option?

4 REPLIES 4

Inactive_Us1474
Giga Guru

Hi,



I suggest if you are using a button tag in UI Page then with onclick of the button trigger the function and return false.


This leads to same page after submission.



Thanks and Hope it helps.


Manik
ServiceNow Employee
ServiceNow Employee

Hi Amol,



As Akhil has mentioned you need to return false from the function which would be trigged onClick of the button.



eg.



<button type="button" onclick="logicFunc()">Submit</button>



function logicFunc(){



//add your current logic over here



return false;


}



this would return the control on the same page.



Thanks,


Manik


PS - Please mark correct , like or helpful if applicable.


IamAmolB
Tera Guru

Hi Akhil/Manik,



I agree we can do that by this way but the thing is i have processing script which i have to execute but the thing is if i wrote return false there, it is not executing my code of processing script.



please suggest according to that.




Regards,


Amol Bavaskar


Manik
ServiceNow Employee
ServiceNow Employee

Hi Amol,



This processing which you are planning to do can be done by making a GlideAjax call from client script so you can create a normal submit button rather than using the macro which is provided by platform and then do the server side processing in a script include by making a glide ajax call.



Thanks,


Manik



PS - Please mark correct, helpful or like if applicable.