XVCL example - HTML Form
The purpose of this example is to illustrate how to use XVCL to create an HTML
document with an HTML form and various HTML controls on it.
Press F9 to generate HTML content...
Components/classes used in this example
- TJvxHTMLElement - incapsulates <HTML> element.
- TJvxHTMLBody - incapsulates HTML <BODY> element.
- TJvxHTMLDiv - incapslates HTML <DIV> element.
- TJvxHTMLForm - incapslates HTML <FORM> element.
- TJvxHTMLInput - incapslates HTML <INPUT> element.
- TJvxXMLGenerator - generates XML/XHTML content from
TJvxHTMLElement object.
Key properties/technologies illustrated in this example
- TJvxNode.Parent - Available to all HTML classes, this property
allows to build complex object hierarchies representing HTML documents.
- property Value - Can be used to assign value to any HTML
attribute. This property is declared with different types specific to a
particular attribute. You can also use generic AsBoolean, AsString, AsInteger,
AsFloat, AsDateTime and AsVariant properties to access attribute or element
values.
- property Text: TStrings - Can be used to manipulate content of
any HTML element that is allowed to have content.
Implementation details
This example creates a template of an HTML document (FHTML). It then creates an
instance of TJvxHTMLForm class and inserts it into the body of the HTML document.
Several instances of TJvxHTMLInput class are created with different values of
InputType attribute to generate edit box, combo box, checkbox, radio buttons and
submit and reset buttons. Instances of TJvxHTMLDiv class are used to generate
labels for controls.
After that an instance of TJvxXMLGenerator class is used to generate HTML
content using the template. Generated content is saved in Output.htm file.
Copyright © 2000-2001 XVCL