- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2014 10:14 AM
I have a non global UI script that is referenced in a UI Macro by a formatter (maybe it's the other way around) so that I can reference all the routines on my modules without the UI script being global.
I'm experiencing very odd timing problems.
I'll make a change in my UI script, reload the module, but the changes don't seem to be taking immediate effect. And I'm not sure exactly how/when to get them to take effect.
I typically run with three browsers open:
Firefox is my main coding browser.
IE11 is used for my reference, IE, to see something else in SVN while coding in Firefox
Chrome I use for testing functionality
Up until now this setup was working fine for me. I'd make a change in Firefox, save it, reload the module in Chrome and see the changes.
Now, however, I'm using the setup above, where a UI script is in a UI Macro that is in a formatter. And I never know when my code is going to take affect. I've tried reloading the module, logging out, closing browsers and relogging, pressing Ctrl-F5 to force a refresh, and I'm getting inconsistent results. Sometimes my code is active, sometimes it isn't. If I check the code, the changes are there in all the browsers, but it seems as if SVN is using an older version somewhere. Right now I have a simple alert() in the beginning of my routine, and IE won't show it, but Firefox will. And my most recent change isn't showing anywhere!
Last time this happened I thought I was running into browser compatibility issues, and I went home for the day slightly distressed that I have code that works in one browser and not another. The next day, without making any changes, it suddenly worked in both browsers! Now I understand it's the same timing issue I'm seeing now.
Any thoughts on this oddness? It's making coding very difficult, as I never know if I have a typo somewhere or if my code just hasn't taken effect yet.
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2014 08:19 AM
I ended up opening a ticket on HI about this. The devs gave me this code to put in the UI Macro which works beautifully:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g2:evaluate var="jvar_stamp">
var gr = new GlideRecord('sys_ui_script');
gr.orderByDesc('sys_updated_on');
gr.query();
gr.next();
gr.getValue('sys_updated_on');
</g2:evaluate>
<g:requires name="YOUR SCRIPT NAME HERE.jsdbx" params="cache=$[jvar_stamp]" />
</j:jelly>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2017 11:37 AM
This script worked better for me. One question - what do you mean by saying, "g2 is null"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2017 02:35 PM
The end of line 2 xmlns:g2="null"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2017 10:58 AM
Here's another good script for multiple files to include:
<g:evaluate var="jvar_ui_script" object="true" > | ||
var gr_ui_script = new GlideRecord('sys_ui_script'); | ||
gr_ui_script.addQuery('nameINmyUIScript1,myUIScript2'); | ||
gr_ui_script.query(); | ||
gr_ui_script; | ||
</g:evaluate> | ||
<j:while test="${jvar_ui_script.next()}"> | ||
<g:requires name="$[jvar_ui_script.getValue('name') ].jsdbx" params="cache=$[jvar_ui_script.getValue('sys_updated_on') ]" /> | ||
</j:while> |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2017 11:21 AM
Hi Bell,
I am running on Helsinki and somehow this is not working even after applying this script to handle cache.What could have been the issue?
Warm regards,
MIlap
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2017 11:27 AM
What script are you using? If you are using the script from Mar 7 above, did you change myUIScript1 and myUIScript2 in 'nameINmyUIScript1,myUIScript2' to the name(s) of your script(s)?