Refresh a Document Viewer

I have a document viewer with a touch of HTML to load an image from a website. Specifically, it loads a radar image from a weather site for display on digital signage. Once the window open it never closes - the project will run for extended periods.

My problem is it never refreshes the image. I’ve read the document viewer is pretty rudimentary, so I don’t know what I could do with HTML. I did try to close the window, but the client is still caching the image.

Any ideas?

I’m going to answer my own question… It isn’t elegant but it works.

I have a client timer to run this code every so often. It reads the html from the document viewer control, sets it to nothing, then sets it back to the original code. Just rewriting the same value without setting it to something else doesn’t cause it to update, the data actually has to change for the control to update.

weather= system.gui.getWindow('Weather')
text = weatherwin.getRootContainer().getComponent('Document Viewer').text
weatherwin.getRootContainer().getComponent('Document Viewer').text = ""
weatherwin.getRootContainer().getComponent('Document Viewer').text = text

This is the end result:

viewtopic.php?p=26514#p26514

What you’re doing sounds like the best way to go about it. You could make it even a little simpler by just setting the text back to itself. I don’t believe you actually have to change the text at all.

weatherwin= system.gui.getWindow('Weather') text = weatherwin.getRootContainer().getComponent('Document Viewer').text weatherwin.getRootContainer().getComponent('Document Viewer').text = text
Is there a reason you’re setting the text property instead of the Page URL property?

I tried it as you suggested first. It actually needs to change. In this case, I don’t have a URL, I have some HTML I wrote by hand to display an image from another site. This resides in the text field of the control.

I see. Well I’m glad you got it working.