3-16 Oracle Fusion Middleware Idoc Script Reference Guide
3.6 Page Variables
Page variables are set on a particular web page to enable specific page attributes or functionality. A page variable applies only to the page on which it is set.
This section includes the following topics:
■
Section 3.6.1, Page Display Variables
■
Section 3.6.2, Field Display Variables
3.6.1 Page Display Variables
Page variables that affect page display are typically set near the top of the page. Page display variables should be used as read-only variables; setting or changing the value
of any of these variables will typically change the way all metadata is displayed on the page, which in most cases is not the desired effect.
The following is a list of Idoc Script page display variables. generateUniqueId
on page 8-105 isCheckin
on page 8-155 isDocPage
on page 8-157 isEditMode
on page 8-160 isFormSubmit
on page 8-168 isInfo
on page 8-170 isQuery
on page 8-181 isUpdate
on page 8-190 isUploadFieldScript
on page 8-191 localPageType
on page 8-208 noMCPrefill
on page 8-218
3.6.2 Field Display Variables
Field display variables can be grouped into the following types:
■
Field Information Variables
■
Common Field Display Variables
■
Other Field Display Variables
3.6.2.1 Field Information Variables
The following variables define information about a metadata field. The variable values are loaded or computed for each metadata field.
fieldCaption on page 8-76
fieldDefault on page 8-79
fieldIsOptionList on page 8-84
fieldName on page 8-86
fieldOptionListType on page 8-87
fieldType on page 8-88
fieldValue on page 8-89
fieldWidth on page 8-91
isRequired on page 8-184
requiredMsg on page 8-243
valueStyle on page 8-357
Master List: Idoc Script by Type 3-17
Example The std_prepare_metafield_include include in the resource file named
IdcHomeDirresourcescorestd_page.htm loads a number of field information variables from the local data in preparation for displaying the current metadata field.
dynamichtml std_prepare_metafield_include --Prepare for presenting field--
fieldName=dName, fieldCaption=dCaption, fieldDefault=dDefaultValue fieldType=dType, fieldIsOptionList=dIsOptionList,
fieldOptionListType=dOptionListType end
3.6.2.2 Common Field Display Variables
There are several commonly used page variables that affect the display of metadata fields. These variables can be set using different syntaxes at different places on a page,
depending on how they are being used.
The following formats can be used to set a special field display variable:
■
NameValue pair: The variable is set using the standard variable=value
format. For example, isHidden=1. This format is typically used to set the display of the current metadata field at the point in the page where the field is being
generated by looped code.
■
FieldName:Variable format: The variable is set by defining it as a parameter for
the metadata field it applies to. For example, myMetadata:isHidden. This format is typically used at the top of a page to set the global display of a particular
metadata field.
If a common field display variable is set at the top of a template page, it should be placed before the HEAD tag. Placing the variable in or after the HEADHEAD
section will result in the field being displayed or not displayed as you intended, but the JavaScript validation code in the header will still be evaluated, so an … is not an
object error will be thrown when you attempt to display a checkin page.
The following is a list of the common field display variables. isExcluded
on page 8-161 isHidden
on page 8-169 isInfoOnly
on page 8-171 isRelocated
on page 8-182 maxLength
on page 8-214 optionListScript
on page 8-225 If these common field display variables are not sufficient to provide the required
flexibility, the entire implementation of a metadata field can be replaced by setting the field variable to the name of a resource include that should be used instead for
example, myField:include=customInclude.
The standard implementation is referred to by the variable defaultFieldInclude , whose value is different depending on whether the field is being generated on a
checkinupdate, query, or info page. It also varies considerably based on the type of field being displayed. If the standard field include is overridden, then the new
implementation must take into consideration all the issues of the different pages, including JavaScript validation and the Upload applet.
Use this approach only as a last resort. It is preferable to extend existing functionality
and set local variables to have custom functionality.
3-18 Oracle Fusion Middleware Idoc Script Reference Guide
If you use the include tag in this way to insert custom HTML code for a special metadata field, you must place the include statement after the HEAD tag on the
page. If you place it before the HEAD tag, the system will insert your custom HTML code into the header and attempt to read it as JavaScript.
3.6.2.3 Other Field Display Variables