Since I have many similar pages, I would like to put the common code on a "template" form. Then I can inherit from this form to add the differences. Will form inheritance work with Webcore?
There is support for form inheritance
Hi Bruno.
There is a slight problem with form inheritance.
- It works perfectly when debugging in windows
- When copied to the web server, it errors on missing html files for the inherited forms. If I create blank html files, the linker copies them to TMSWeb folder and it all works.
If there is a Form_M and I use form inheritance to create Form_I, then
Form_I.html
is missing.
Are both forms (with their HTML) in the project, i.e. you have in the .dpr file?
Unit1 in 'Unit1.pas' {Form1: TWebForm} {*.html},
Unit2 in 'Unit2.pas' {Form2: TWebForm} {*.html};
Not on those forms. I am guessing that its because I haven't made any changes from the inherited parent form (YET).
Suggestion - seeing that it is a form and will require an html file at some stage, why not create it at the same time that the dfm is created.
Next question. When I launch a popup child form from another popup child form, its visually annoying. Is there a way to colour the form caption bar (for the previous form) to a disabled look?
I could probably make the previous form invisible, but I would have preferred it to be seen.
When I choose "inherit from form" in the IDE, it creates the new inherited form with both DFM & HTML automatically.
At this moment, the caption does not automatically show in a disabled state. This is a good suggestion. We will consider it to extend the behavior with this capability.
I have now tried with about a dozen forms. It doesn't for me. Even when I tag the form in the dpr file with {*html}, it doesn't create it. If I create a blank one, everything works fine.
Its not stopping me from working though.
I suggest to compare with our demo and if a problem persists, send a sample source project with which we can reproduce your problem.