Loading HTML file at build time

I'm using WebCore in the Delphi IDE but now do all my UI design in VS Code. All of my forms have a single component - a TWebHTMLContainer. I then copy the HTML from the body of the file in VS Code into the HTML property of the TWebHTMLContainer. As you can imagine this is a serious pain point - it's just too easy to forget to copy/paste changes from VS code, and is anyway pretty cumbersome.

Ideally the TWebHTMLContainer would have an HTMLFile property, where the content between the body tags in the local VS Code file would be loaded at build time. The build process would therefore include an additional step where the HTML is extracted from the file and injected into the HTML property (over-writing anything that's already there).

Another option would be to remove the distinction between direct and "standard" forms (i.e. each will have an associated HTML file), but then have a form property which dictates whether the form behaves as a direct form or a standard form. For the direct setting the HTML would then be loaded from the file body at build time.

Thanks, Bob

This is the first such request we got.
Couldn't you integrate this as a prebuild command to process the form's DFM file and insert the content of a HTML file in the WebHTMLContainer.HTML in the DFM file?

Thanks - not something I've ever used but sounds promising. I'll take a look.

I still think though that something similar to what I proposed would be really useful. WebCore is of course very impressive but it would be good to have options that don't involve the "big bang" of loading all the Javascript up front. For example, my index.html has my main UI that can be quickly displayed with minimal javascript required. This is why my app is built entirely using direct forms.

Cheers, Bob

We will monitor this and check feedback/demand from other users as well in this area.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.