Templates not refreshing after client changes

We are running 7.7.7 (planning to upgrade but have to upgrade custom modules first) and have some issues with templates and template repeaters updating incorrectly or more likely not updating bound properties after changes. It appears that some bound properties are sometimes not working correctly after switching user accounts or machines being hibernated/thawed or downloading updates after projects are published.

For example we have images that are bound to a tag value via expression and depending on the tag state it will show an image inconsistent with current tag state (not using Styles just binding to Image Path). We dont the see problem with same setup outside of templates and they always shows correct overlays and the images.

It also happens with bound properties in other cases that are not bound to tags and are just binding data from one template to another but haven’t fully isolated the exact issue there yet. The problem seems worse if there is a template inside another template or template repeater. It does not always require a user switch to reproduce so but its the most reliable way in my experience.

Post part of this in design forum here. I may possibly try to manually script something to disconnect/connect templates on change to see if that can workaround the issue but feels kludgy.

It may just be that we need to upgrade and hope but we are showing incorrect status to users sometimes and I want to mitigate that even if that means closing all screens when switch user is used or similar.

Consider upgrading to v7.7.8 while working on your module(s). That version allows you to omit the required framework version property in your module.xml file. Which makes it possible to run the same module on v7.8.3+ and v7.9+, too. Those versions are also the ones you need to sign your own modules. With any luck, v7.7.8 fixes the problem you’re having.

So the problem seems to be with PMIImage and probably something with bindings. In many cases the binding all appear correct and the imagepath is even correct but the wrong image is being displayed. If I use originalPath=c.getPath();c.setPath(’’);c.setPath(originalPath) it seems to fix the issue under some conditions.

I’m not sure I can really update to 7.7.8 in production easily. Will continue to experiment I guess.

In the event someone stumbles upon this and wonders what I’ve done.

For the time being I think I’ve settled on a Client Event Script which binds to the following tags:


Then uses a system.util.invokeLater() callback a few seconds after execution to trigger some cleanups. Also explicitly invoke it after calling the switchUser function. I’d like to invoke it on activateOpen on windows but that requires changing every screen so the multiple second delay will have to suffice I hope. That jython script recursively walks through every control and looks for for PMIImage controls which it will then unset and reset the image path. It then also disconnects and reconnects binding adapters on the adapter though not sure that was effectively doing anything so might disable that.

Still feels dirty but seems to mitigate the immediate problem. Not going to mark it solved yet but is reasonably generic and hides immediate incorrect result.

Possibly missing a solution for the disconnected laptop refresh issue but hoping those system tags will change quality. If not I might grab another global tag for invoking the repair script on quality change.