Greg thanks. We rely on your knowledge of how the Web 2.0 architecture is written, so many thanks again, even if my question seemed redundant. Your patience with newbies is appreciated.
FWIW, I did instantiate a WebFile object from a disk file in the WebHTMLViewer.Opening event and then tried to load it by calling WebHTMLViewer.GoToURL() as in this code…
var f as folderItem = new FolderItem ("/path/file.html", FolderItem.PathModes.Native)
if f <> nil and f.exists then
var wf as WebFile = WebFile.Open(f)
wf.MIMEtype = "text/html"
wf.FileName = "file.html"
Nothing appeared in the viewer, and the browsers’ inspector showed empty content in the HTMLViewer’s iFrame. Thus my frustration and my question. I was certainly doing something wrong…
After more fruitless tries, I re-read the WebFile docs in the LR. I finally noticed a small detail in the fine print … a WebFile needs to be loaded and retained in a property of the App object…quote:
You need to save the reference. The best way to do this is to use a property of the WebApplication Class
Its only just a few words in the docs, but when I moved the same WebFile instantiation code to the App.Opening event, retained the resulting WebFile object in an App.property, and then called the following code in the WebHTMLViewer.Opening event, it work just as you said.
I must admit this is a different behaviour in contrast to Desktop controls where I am most familiar with loading resources in the control’s Open event and avoiding populating the global App object.
The difference is subtle, but important, and thus I am replying on this thread for the benefit of future readers who may bump against this same subtly.
I must admit that I do miss all the illustrative example projects that once inhabited the Web 1.0 Extras folder. Seeing is believing…
Thanks again to all for their help.