Refreshing resources

0
Hi all Mendix GURUs. How can i refresh mendix resources. I am creating custom widget. It includes HTML template file. If i make some change, zip files into mpk file, upload it to my project and hit F4. If in JS file i want to do for example somethink like this: this.connect(this.saveButton, "onclick", dojo.hitch(this, this.doSelection)); where saveButton is an HTML item in HTML template Mendix do not know this new item and rendering of widget fails. I discovered only when i rename rename HTML template, changes are visible in mendix. Also i have tried to delete CustomWidgetDirectory from project\deployment\web\ but also no change in rendering. Can somebody help where is the correct way how to do it? Thanks, Lukas
asked
2 answers
1

This sounds like a caching issue. In 3.0 all assets are stored in the cache, except for a few special cases, like theme assets (though this depends on the server configuration). A cache bust which changes between deployments is used to revalidate. To avoid caching over deployments when fetching assets yourself, you should use this cache bust, provided by mx.server.getCacheBust.

mx.moduleUrl("DailyStaffRota.widget", "templates/DailyStaffRota.html") + "?" + mx.server.getCacheBust()

It would be easier if moduleUrl automatically added the cache bust to the given url, but for now this would be the way to go.

answered
0

There is a bad syntax... work like this:

mx.moduleUrl("DailyStaffRota.widget", "templates/DailyStaffRota.html?" + mx.server.getCacheBust())

Regards

answered