Layout of Static Server Pages

Static server page layouts are XHTML-based and include Uniface-specific tags to define the component data structure, as well as standard XHTML for defining the layout and appearance. The structure of the layout is best viewed in the XHTML source.

Both dynamic and static server pages consist of a header and a body.

Header

The <head> of static server pages can contain the following special Uniface definitions:

  • <x-option fieldcheck="TRUE">—browser syntax checking switch. If set to TRUE, field syntax checking is performed in the browser during deployment. For more information, see <x-option>.

    Note:  <x-option> is not an XHTML element. It provides optional instructions for webgen when it generates an XHTML file to the browser.

  • <x-subst type="function" name="$formtitle"></x-subst>—generates the title of the server page from the ProcScript function $formtitle during deployment. For more information, see <x-subst type="function">.

Body

The <body> of static server pages can contain the following Uniface definitions:

  • JavaScript—JavaScript, such as the script for syntax checking, is loaded whenever the page is loaded. This is defined in the <body> tag as:
    <body class="" onload="uLoad(this)">
  • <form> tag—enables the server page to submit data to the Web server so that Uniface can process user requests and create responses back to the browser. The <form> tag has the following syntax:

    <form name="Name" method="HTTPmethod" action="URL" target="frame_Name" enctype="Datatype" onsubmit="script_commands">

    • name—specifies the name of the form.
    • method—refers to the HTTP method by which the data is sent. Uniface uses the POST method.
    • action—indicates the URL to which the data is sent. For a Uniface Web application, this points to the server page and operation that handles the request. For more information, see Calling Operations on Static Server Pages.
    • target—allows the developer to direct the response to a particular frame or browser window.
    • enctype—indicates the format of data to be sent.
    • onsubmit—specifies an event handler. The event occurs when the user attempts to submit the form.

    For example <form method="POST" action="MYUSP" onsubmit="return uSubmit(this)">

  • Uniface data substitution placeholders—Uniface-specific XHTML tags for defining the component data structure:

    • <x-entity>—represents a component entity. A server page must contain at least one entity. <x-entity> tags can be nested to reflect the data structure. The position and attributes of the <x-entity> tags determine whether the entity data is sent to the browser. For more information, see <x-entity>.
    • <x-occurrence>—represents entity occurrences. Occurrences must be defined as an <x-occurrence> element within the <x-entity> element. For more information, see <x-occurrence>.
    • <x-subst type="FieldType">—represents a field. A field must be defined as a <x-subst> element within an <x-occurrence>, or directly within the <x-entity>, if only one occurrence is needed (for example button fields for submitting the server page to the Web server). For more information, see <x-subst type="WidgetType"> .

Related Topics