HTML files and direct forms

In an earlier thread it was mentioned that the ability to link an HTML file to a direct form would be investigated - any chance this will be in the next version? I'm currently kludging things by building my HTML/CSS in VS Code and copying the HTML into a TWebHTMLDiv on the web form (the only component on the form). It works but is a maintenance nightmare. Even being able to link a file to a TWebHTMLDiv would be good enough.

Thanks, Bob

I'm not sure I understand what exactly you want to do.
When you want the HTML template to be associated with a form, you can use the web form as-is and you do not need the direct form approach. The direct form approach was introduced just to avoid the use/loading of the HTML template with it.

Hi Bruno - it was previously discussed here:

My app consists of a main project HTML file with the main HTML/CSS already defined, and direct forms for everything else. I want to be able to associate HTML templates with direct forms that won't over-write my main project HTML. My forms have no code at all - apart from simple code to set up bindings. I'm currently implementing the forms by dropping a TWebHTMLDiv on each form and copying the HTML from separate external files, but you can see how messy that quickly becomes.

In fact, although quite cool, the ability to specify separate HTML snippets inside controls is a maintenance nightmare. If it were possible to specify a new HTMLFile property for all controls that currently have the HTML strings property this would be a big improvement. Obviously it would need some parsing, e.g. the default might be to extract HTML within the body of the linked file at build time.

Thanks, Bob

Maybe we can introduce a new component like a TWebHTMLContainer that gets its content from a URL?

That's a good idea - would be very useful. Could it be dual mode though - option to get content from a URL at runtime, or a file at build time? Maybe also a REST service at runtime - just to get greedy :-)

My first choice would be a file at build time though - that would solve my immediate problem.

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

We'll further reflect & investigate how to shape this best.

We gave TWebHTMLContainer the option to load HTML from an URL. This will be in v2.2

1 Like