g_modal is closing on URL change in Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 11:15 PM
Hello Experts,
I have developed an UI page to open in a g_modal for workspace. Once I am clicking the button, its opening the popup correctly. Inside the popup, there are list of records which are actually hyperlinks. Once I click any one of them to open, the record opens up and getting closed immediately. Is there any solution for this ?
This is the below code for opening the popup:
var url = '/sn_oper_res_test_output_list.do';
g_modal.showFrame({
url: url,
title: 'Test Output',
height: '600em',
width: '600em',
});
Thanks,
Satanik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 11:30 PM
Hi @Satanik1
Using target="_blank" will prevent the modal from closing when a hyperlink inside it is clicked, as it opens the link in a new tab.
<a href="/your_record_url" target="_blank">Open Record</a>
……………………………………………………………………………………………………
Please Mark it helpful 👍and Accept Solution✔️!! If this helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 11:54 PM
Hi Satish,
Thanks for responding. I am not using target="_blank" in the link. here is the code below.
<j:while test="${grScenAnalysis.next()}">
<tr>
<td><a href="/sn_oper_res_test_output.do?sysparm_sys_id=${grScenAnalysis.sys_id}">${grScenAnalysis.number}</a></td>
<td>${grScenAnalysis.name}</td>
<td>${grScenAnalysis.assigned_to.getDisplayValue()}</td>
<td>${grScenAnalysis.state.getDisplayValue()}</td>
</tr>
</j:while>
Thanks,
Satanik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2024 12:02 AM
Hi @Satanik1
To prevent the modal from closing when clicking hyperlinks:
Avoid Full Page Reloads: Ensure that clicking links doesn’t trigger a page reload.
Use AJAX for Dynamic Content: Fetch and display content dynamically within the modal using AJAX instead of navigating directly.
……………………………………………………………………………………………………
Please Mark it helpful and Accept Solution!! If this helps you!!