View Element Reference

< field  />

This element specifies a column of data within the enclosing control. When it is a direct child of the <dataSource> element, the field can be viewed as forming the retrieving query’s SELECT clause. When the element is a direct child of a <panel> element, the field indicate which of the retrieved data is available in the user interface. A <field> element may be used in a panel context to present controls such as buttons via the controlType="button" attribute, verbatim HTML via an enclosed <html> element ( See "Creating Custom HTML Form Fields" ), or to place hidden data into the page for use by JavaScript code.

<dataSource>
<table name="wr" />
<field table="wr" name="rm_id"/>
<field table="wr" name="description"/>
</dataSource>


<panel type="form" columns="2">
<field table="wr" name="wr_id"/>
<field id="user_email" controlType="text" value="${user.email}">
<title translatable="false">${user.name} Email</title>
</field>
<field table="wr" name="status" readOnly="${!user.isMemberOfGroup('FIM')}"/>
</panel>

<panel type="grid">
<field controlType="button" enabled="${record['project.status'] == 'CREATED'}" onclick="requestProject">
<title translatable="true">Request</title>
</field>
<field table="project" name="project_id" controlType="link">
<command type="showPanel" panelId="project_details">
</field>
</panel>

Note: Setting the default value for an enumerated field in a view using <field value=”xxx”> will not work UNLESS the default value for the field is the same as the first value in the enumeration list. Thus, you must re-order the values in an enumeration list to make the default value the first value in the list.

Enclosing Element: This tag is a direct child of a <dataSource> or <panel> element .
Encloses: When used within the <panel> element, this tag may enclose <title> , <action> , and <command> child elements.
Attributes
Attribute Description Valid Values Optional
multiple See Select Multiple Values .
id When the field is used in a presentation panel, specifies an id for the field, overriding the default value. a string unique within the panel. yes
table Specifies which table in the data source should be used to access the field value. a valid table name in the data source yes
name Specifies, along with the table attribute, which column should be the source of the field value.

a valid field name in the data source table

yes
readOnly When the field is used in a presentation panel, this attribute states whether the field will be editable by the user. true or false , defaulting to false . yes
required When the field is used in a presentation panel, this attribute states whether changes may be saved if this field has a non-null value. true or false defaulting to false. yes
hidden When the field is used in a presentation panel, this attribute states whether the field will be filled with data, but not actually displayed. This is useful when the field needs to be a source of data for scripts, but should not be show on the page. true or false defaulting to false. yes
enabled Typically used with a condition to dynamically enable or disable a field with controlType="button". A condition that evaluates to true or false , typically using a binding expression such as ${!user.isMemberOfGroup('FIM')} which compares the current user with an established security group yes
controlType Add an input control to a grid column or form. A field with controlType="link" turns a grid column into a linked value. A report field with controlType="button" creates per-row buttons. A controlType of button or link requires also specifying either an onclick attribute or child <command> elements. A controlType of image must also specify the imageName attribute. A controlType of text is used in edit forms to create a custom input field, and is accompanied by a field id. button , link , image , text yes
onclick
onblur
onfocus
onchange
onkeypress
Allows the addition of custom JavaScript event handlers to a particular field. a name of an existing JavaScript function yes
colspan When the field is presented in a form containing multiple columns of label – value pairs, this attribute allows a field to cover more than one column. a ‘small’ number between one (the default) and the number of columns used as the panel attribute yes
rowspan When the field is presented in a form, this attribute allows a field's value control (e.g., a textBox) to cover more than one row. a ‘small’ number between one (the default) and the number of rows remaining below this field in the form yes
value When the field is used in a presentation panel, this attribute provides a default value that can be overridden by user. The default value is used when initializing a form or using form values in creating a restriction for another panel. any valid value for the field, often using binding expressions such as ${user.email} yes
alias When the field’s table and name attribute values are used more than once within a presentation panel, the field must get an alias to distinguish one field instance from the other. a string unique among a panel’s aliases and field table-dot-name combinations yes, unless table and name attribute values are repeated within the panel
cssClass The CSS class to be used in styling the field’s value element in the presentation panel. any valid CCS class name available in the standard or user-developed stylesheets yes
labelClass In Archibus 1.3 views, the CSS class to be used in styling the field’s label in the presentation panel. Note: Archibus 2.0 views don't support labelClass; this was supported by Archibus 1.3 views. Any valid CCS class name available in the standard or user-developed stylesheets yes
style Specifies an HTML style attribute for a field. stylesheet fragment such as "height:200; width:400;" yes
width Specifies the amount of horizontal space to be devoted to a presented field. Typically this attribute is used for buttons in a report row, but it can also be used to ensure the minimum size of a specific field. You can use this attribute for multiple grid fields, but at least one field should not have this attribute.

Value compatible with the CSS width specification. Recommended values are either relative to the grid panel width (e.g. width=“25%”) or absolute (e.g. width=”100px”)

Example: schema/ab-products/solutions/parts/grid/ab-ex-report-grid-hidden-columns.axvw

yes
size When the field element is used in a presentation panel, this attribute specifies how may total spaces will be presented for a number field. This attribute is typically used along with dataType and decimals attributes when the value of dataType is “number.” Typically, these two attributes are needed for calculated fields introduced in a <dataSource> element’s child <sql> element because the field does not have a record in the data dictionary specifying its formatting preferences. Alternately, the size and decimals attributes can be used for existing fields if it is necessary to override the default preferences. a ‘small’ integer yes
imageName Used in conjunction with the controlType=’image’ to construct an imageButton. a name of an existing .gif, .jpg, etc., or other image file type. When searching for an image file, Web Central will first look in the same folder as the including AXVW file, and then search in folders defined in \WEB-INF\config\context\compatibility\afm-config.xml in the <searchDirectories> element under a <fileCategory> with extension gif , jpg , etc yes
dataType When the field element is used in a presentation panel, this attribute is used to specify the formatting of the field. Typically, this attribute is needed for fields introduced in a <dataSource> element’s child <sql> element because the field does not have a record in the data dictionary specifying its formatting preferences. Alternately, this attribute may be used to narrow the type from the default, as long as it is compatible with the data type specified in the metadata. almost all AFM Types are available yes, unless the field is a calculated field.
decimals When the field element is used in a presentation panel, this attribute specifies how may decimal places will be presented for a number field. This attribute is typically used along with dataType and size attributes, when the value of dataType is “number” a ‘small’ integer yes
op When the field is used in a presentation form, and the values of the form field is used in a query, this attribute overrides the default equals operator to allow the query to select records that have a field value, for example, greater than or equal to the field value any mathematical binary operator usable in a SQL WHERE clause yes
selectValueType Select value dialog display type. By default, the tree control version of the Select Value dialog is used automatically for N-tier hierarchy fields. You can force a regular field to use the Tree Select Value dialog by setting this attribute to tree tree yes
showSelectValueAction When the field is used in a presentation panel, and the field gets a selectValue action by default, this attribute provides a means of turning the default control off so that the field may be edited directly or another editing control substituted for the default true, false , showSelectValueAction defaults to true for all fields in “console” type panels. showSelectValueAction defaults to true for foreign keys and to false for all other fields in “form” type panels yes
showLabel yes
When the field is used in a presentation panel, this attribute provides a means of hiding the field's label to show only the field value true, false , defaulting to true yes
showText When the field is used in a presentation panel, this attribute provides a means of hiding the field's value to show only the field label true, false , defaulting to true yes
groupBy When the field is used in a dataSource whose type="grouping" , this attribute specifies one of the fields on which the presented dataset will be grouped. When linked to by a multi-record panel (i.e., report, dataView) grouping dataSource orders the records and allows for a summary record to be calculated for each group of records true, false , defaulting to false yes
formula When the field is used in a dataSource whose type="grouping" , this attribute is used for a field in the summary record to specify how the data is to be aggregated for the group. This attribute is used along with the name, baseField, and dataType attributes to construct a field for the summary record sum, count, avg, min, max . yes
baseField When the field is used in a dataSource whose type="grouping" , this attribute specifies the source field for the aggregate function to roll up data for a field in the summary record. This attribute is used along with the name, baseField, and dataType attributes to construct a field for the summary record. a field existing in one of the tables included in this dataSource yes
showCheckInDialog By default, the standard document field’s Check In action displays the Document Check-in dialog. Replace the standard Document Check-in dialog by a Browse button that acts as a simple document file selector by setting the showCheckInDialog attribute to false . yes
legendKey When the field is used in a panel of type="drawing" , this attribute specifies one of the fields that will be shown in a legend true, false , defaulting to true yes