- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2014 03:19 PM
Hi,
I created a UI Macro button that's supposed to redirect to a new table, but it doesn't seem to work. It somehow always attempts to create a new incident record instead.
So I created a new macro with the following code:
<?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 onClick="return testF();"> Edit </button>
<script>
function testF()
{
window.location = 'u_test_table.do';
}
</script>
</j:jelly>
u_test_table is the new table I created.
I created a new formatter that uses this macro and added that to the incident table.
When I open an incident and I click on the button, it actually creates a new incident record. I know it does the redirection as well because if I changed it to:
window.open() instead, it does open a new tab to the new table, but the current location also creates a new incident record.
Is there something I'm missing? I don't want it to create a new incident record, just redirect to the new url.
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2014 09:10 PM
Jason,
This time it should work. Please try change your script part
<script>
function testF()
{
window.location = '/u_test_table.do';
return false;
}
</script>
That is add return false; after redirection.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2014 08:27 PM
Jason,
I may be wrong here, but can you give a try once by adding '/' in the url i.e
window.location = '/u_test_table.do';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2014 08:54 PM
unfortunately it doesn't work. it still creates a new incident
i don't know if it's my environment or some known bug or something i'm missing ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2014 09:10 PM
Jason,
This time it should work. Please try change your script part
<script>
function testF()
{
window.location = '/u_test_table.do';
return false;
}
</script>
That is add return false; after redirection.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2014 09:14 PM
genius!
thank you. it works