RAD Studio
ContentsIndex
PreviousUpNext
Setting Web Item Properties

The Web items that you add using the Web page editor are specialized components that generate HTML. Each Web item class is designed to produce a specific control or section of the final HTML document, but a common set of properties influences the appearance of the final HTML. 

When a Web item represents information from the XML data packet (for example, when it generates a set of field or parameter display controls or a button that manipulates the data), the XMLBroker property associates the Web item with the XML broker that manages the data packet. You can further specify a dataset that is contained in a dataset field of that data packet using the XMLDataSetField property. If the Web item represents a specific field or parameter value, the Web item has a FieldName or ParamName property. 

You can apply a style attribute to any Web item, thereby influencing the overall appearance of all the HTML it generates. Styles and style sheets are part of the HTML 4 standard. They allow an HTML document to define a set of display attributes that apply to a tag and everything in its scope. Web items offer a flexible selection of ways to use them: 

The simplest way to use styles is to define a style attribute directly on the Web item. To do this, use the Style property. The value of Style is simply the attribute definition portion of a standard HTML style definition, such as,

color: red.

You can define a style sheet that defines a set of style definitions. Each definition includes a style selector (the name of a tag to which the style always applies or a user-defined style name) and the attribute definition in curly braces,

H2 B  {color: red}
.MyStyle  {font-family: arial; font-weight: bold; font-size: 18px }

The entire set of definitions is maintained by the InternetExpress page producer as its Styles property. Each Web item can then reference the styles with user-defined names by setting its StyleRule property. 

If you are sharing a style sheet with other applications, you can also supply the style definitions as the value of the InternetExpress page producer's StylesFile property instead of the Styles property. Individual Web items still reference styles using the StyleRule property. 

Another common property of Web items is the Custom property. Custom includes a set of options that you add to the generated HTML tag. HTML defines a different set of options for each type of tag. The VCL reference for the Custom property of most Web items gives an example of possible options. For more information on possible options, use an HTML reference.

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!