HTML-based direct forms

As a follow-on to my recent post regarding specifying which HTML file a form uses, what I really need is an HTML-based direct form, i.e. one which has a pas and an html file, but no dfm. Or even if it has an empty dfm, to be able to toggle the form behaviour - i.e. no replacement of the index HTML file body.

Thanks, Bob

How is this form expected to behave as there is no TForm class as normally referenced from the DFM file?
Is this for just showing a static HTML file? If so, can't you just do a navigate to this static HTML file?

there is no TForm class as normally referenced from the DFM file

Yeah I was thinking that keeping the dfm would be the easiest approach, but keep it empty and have a "Direct" property to toggle the behaviour of the form. Maybe then disable the Direct option if the dfm isn't empty to avoid conflicts? As you say, another option is to grab the HTML separately and I'm looking into the best way to do that.

I prefer not to have forms full of code (in fact with any code) so use KnockoutJS with view models bound to the HTML elements. This works really well and I'm trying to get a more web-like development workflow, with Delphi code linking everything together. For example, I much prefer developing my UI using CSS than drag-and-drop - it gives much better re-usability. having said that I still sometimes use code to set the Knockout attributes.

Another aspect that causes me trouble is CSS libraries with composite components. For example, I use BeerCSS which has a really nice input component involving a div wrapper. At the moment I use a direct form and a TWebHTMLDiv with the appropriate BeerCSS classes and with its HTML property populated with the input and label elements. It works fine but gets tedious going through the form updating the HTML properties.

Anyway, short version is that having a direct form with the ability to link an HTML template would be very useful!

Cheers, Bob

It's on the todolist to research

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