Pure-HTML Direct Form

I'm back using WebCore (v2.9) after a gap of a year and am looking to improve my development process. I've posted in the past about my problem (HTML files and direct forms) but here's a recap:

  1. I use direct forms exclusively.
  2. Each form has a single TWebHTMLDiv and most forms have no code (or almost no code)
  3. I use KnockoutJS for an MVVM approach
  4. All views are developed in VS Code
  5. All code is in Delphi viewmodels linked to the elements defined in VS Code
  6. The HTML of the VS Code view is copied to the HTML property of the TWebHTMLDiv

This generally works really well and I have complete separation of code and UI but the problems are:

  1. The HTML editor in TWebHTMLDiv runs like a dog if there are a few hundred lines of HTML - each character edit takes several seconds.
  2. More important, the copying of HTML from file to component property is very error prone and it's easy to lose track of changes.

Ideally I'd have the ability to specify a file for the HTML but I have a memory of Bruno suggesting a post-build process where I inject the HTML (but can't find the reference).

I know that WebCore does a bit of HTML manipulation in the background so I'm after some advice on how to implement a post-build process - specifically at which point I should add my HTML that is compatible with WebCore's build process.

Thanks, Bob

Have you considered using the TWebHTMLContainer control that has a URL property via which you can specify the link to the HTML template you want to have in this control?

Thanks - I'll take a look. I have a vague memory I did but it's been a while :slight_smile:

Cheers, Bob