Previous Topic: Action Diagram Code ElementsNext Topic: MAKE Support


HTML Control and HTML Text

The contents of HTML Control and HTML Text are not compatible between Web View and other CA Gen web products.

The contents must be XHTML compliant. You may verify XHTML compliance using a validator such as http://validator.w3.org/. Place the content that is to be validated in the <body> section of an XHTML document as shown next:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Content To Validate </title>
  <meta http-equiv="X-UA-Compatible" content="IE=8" />
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
 <body>
<!—Place the content to be validated inside the body section -->
 </body>
</html>

Do not include CDATA sections in the XHTML document. Even though CDATA sections are valid in an XHTML document, they are not allowed in a Web View HTML Control or HTML Text element.

Special characters must be escaped using the &; notation. The most common character that is likely to be found in user code is the ‘&’ character which is escaped as ‘&amp;’. Proper validation will help identify special characters in the content.

Minimize the usage of <style> tags as Internet Explorer has limitations on the number of CSS selectors that can be included in a document. Web View uses a technique that stacks opened windows, which in a single HTML document causes a large number of CSS selectors to be loaded.

If the custom content in an HTML control needs to be referenced using the ID, you need to wrap the content inside its own div with the appropriate ID. The Web View controls do not use the same ID naming conventions as Web Generation. If you intend to use the model only for Web View, you can use the className property, which matches the controls name instead of using the ID.

Each HTML Control and HTML Text element is rendered in a separate <iframe> tag in the HTML document. References between the contents of different controls is done by first referencing the <iframe> and then referencing the content relative to the <iframe>.

Example:

An HTML Text element named “HTMLText1” contains the following JavaScript:

<script> var mydate=new Date(); </script>

From another HTML Control or HTML Text element, the variable “mydate” would be referenced using the following JavaScript syntax:

top.document.querySelector(".HTMLText1").contentWindow.mydate

As an alternative to specifying HTML content that is inserted into either the <head> or <body> tags of the <iframes> HTML page, an entire document may be included. If the generator reads that the content begins with <!DOCTYPE> statement, the entire content is loaded into the <iframe>, as is, instead of being inserted into a pre-defined HTML page. No validation is done at generation time to ensure that the document is valid. It is the CA Gen developers responsibility to supply valid content.