dataentry Elements

 

Content

Overview

dataentrylist Element

Description

Options

Example

Properties

Other Data Entry Features

Data Locking

JavaScript Functions

and Fill Features

Behavior of onChange Events

Released Data

Sorting

   

dataentrygrid Element

Description

Options

Examples

Properties

Additional Features

 

Overview

 

These dataentry Elements (dataentrylist and dataentrygrid) are used only with Classic Data Entry pages.

You must render these Elements using an element tag in one of your own Page Types or a custom JSP. You must be thoroughly familiar with JSPs and LabVantage Custom Tags in order to do this. For example:

<sapphire:sdiform id="DEList">

<sapphire:sdi sdcid="Sample" keyid1="S-010605-00001;S-010605-00003;S-010605-00005" request="primary,dataset,dataitem">

<sapphire:element elementid="DEListElement" type="dataentrylist"/>

</sapphire:sdi>

</sapphire:sdiform>

Note that:

The sdi tag retrieves the result sets. You must specify the primary, dataset, and dataitem Result Set Types (you need them to enter data).
Attributes of the element tag must point to the relevant Element and Element Type (read all of Working with JSPs, particularly the Example Using Element Properties).
Nesting all of this within an sdiform tag lets you do things such as pass the form id to a JavaScript function (see JavaScript Functions for Data Entry Elements).

 

dataentrylist Element

 

Description

Dataentrylist Elements render a collapsible/expandable list of SDIs and their associated Data Sets. For each Data Item, this Element renders an input field for entering data.

Options

Specialized Variables

In addition to the Variables available for use in all Elements, the dataentrylist Element also lets you use the following specialized variables:

Variable Returns...
[datasetkey] All keys required to describe the current Data Set. The following example shows the syntax of the return:

sdcid=Sample&keyid1=S-01&paramlistid=Metals&paramlistversionid=1&variantid=1&dataset=1

[dataitemkey] All keys required to describe the current Data Item. The following example shows the syntax of the return:

sdcid=Sample&keyid1=S-01&paramlistid=Metals&paramlistversionid=1&variantid=1&dataset=1&paramid=Al&paramtype=Standard&replicateid=1

[rowid] Number of the current row in the HTML table rendered on the page. Dataentry Elements render each row as an HTML <input> tag, and assign identifiers to each rendered row using the syntax

din_enteredtext

where n is the row number beginning from zero, e.g., di0_enteredtext, di1_enteredtext, di2_enteredtext. The [rowid] variable returns the value of n.

To get the value of this variable for any row, you can use JavaScript and the DOM to do something like

document.getElementById( 'di[rowid]_enteredtext' ).value

Data Identification

As mentioned above in Specialized Variables, Dataentry Elements render each row as an HTML <input> tag. To provide additional information about the retrieved data, Dataentry Elements render the following attributes of the <input> tag:

Attribute Description
released Indicates whether or not data have been Released:
Y = Released
N = Not Released

Also see Released Data in the section Other Data Entry Features below.

mandatory Indicates whether or not data entry is mandatory:
Y = Mandatory
N = Not Mandatory
datatype Indicates one of the standard LabVantage Data Types:
ValueLabVantage Data Type
DDate
NNumeric
NCNumeric Calculated
RReference Type
SSDI
TText
VValidated Reference Type

Example

The following items reference the representative example above. Properties of the dataentrylist Element control the behavior of these items.

Referenced Item Feature Shown
1 Primary Values retrieved from columns in the primary SDC. Use the "Show Primary" property to show/hide these values.

Expanding/collapsing the Primary shows/hides Data Sets assigned to SDIs belonging to the primary SDC.

The checkbox "selects" the Primary, allowing you to use JavaScript functions (see JavaScript Functions for Data Entry Elements).

2 Data Set Values retrieved from the Data Set assigned to the SDI.

Expanding/collapsing the Data Set shows/hides Data Items in the Data Set. Use the "Show Dataitem header" property to show/hide the header for the Data Items.

A checkbox in the header "selects" all Data Items (Al and Fe) in the Data Set. Similarly, each Data Item has a checkbox. These let you use JavaScript functions.

In this example, the "Value" column of the Data Set is the "Data Entry Column".

3 Data Set header header identifying the Data Set columns. Use the "Show Dataset header" property to show/hide this.
4 Data Item header header identifying the Data Item columns. Use the "Show Dataitem header" property to show/hide this.

dataentrylist Element Properties

Property Name Description
Show Primary Yes shows SDIs belonging to the primary SDC. You will be entering data for the Data Sets assigned to these SDIs. This renders an HTML table row containing information defined by the values of the Primary Columns properties.
Show Dataitem Yes shows Data Items in each Data Set.
Show Dataset header Yes renders a header for each Data Set assigned to each SDI. The header contains information for each Data Set column, as defined by the Dataset Columns properties.
Show Dataitem header Yes renders a header for Data Items in each Data Set. The header contains information for each Data Item column, as defined by the Dataitem Columns properties.
Show Checkbox "Yes" shows selection checkboxes before each Parameter and Data Item.
Read Only "Yes" displays the value as read-only.
NOTE:Your Data Entry page should look at this property to determine whether or not it should lock the data. If View Only is "Yes", data should not lock.
Primary Columns Specifies attributes of the columns for the Primary SDC:
Property NameDescription
IdentifierUnique identifier for this item, rendered as an ID attribute in the HTML tag.
Column IdColumn identifier for SDIs belonging to the primary SDC. For example, if the SDC is Sample, you would enter s_sampleid (minimally), and possibly other columns such as sampledesc, createdt, etc.
titleText rendered on the page to identify the Column Id (above).
WidthWidth of the column in pixies.
AlignmentHorizontal alignment of values within the rendered column (left, middle, right).
Link URL Specifies attributes of a hyperlinked Column Id (above):
Property NameDescription
HRefDestination of the link, specified as a call to the Request Controller. For syntax rules and guidelines, see Request Controller and Variables.
Target Name of the window in which the linked page opens. You can enter any name here, and the new window (browser instance) will automatically assume that name. If you do not specify a target, the linked page opens in the current window.
TipPopup text displayed on mouseover.
Display ValueValues displayed in place of the corresponding retrieved values. Separate each with a semicolon. For example, if you retrieve values from the createby column, you could specify JDrake=JD. All values retrieved as JDrake would then be displayed as JD. This works only if you replace the entire retrieved string (it does not work on partial strings).
PseudocolumnA "pseudocolumn" is a column that is rendered on the page, but does not exist in the SDC. Do not choose a database columnid when specifying a pseudocolumn. If you want to access this pseudocolumn using a JavaScript function or another pseudocolumn, specify an identifier of your own choice.

This value you enter can be HTML or a Variable. For example:

If you enter an HTML image tag, then specify a link (using the Link URL property above), the image becomes a hyperlink.
If you use a variable, the variable must point to one of the columns defined by the Column Id property for the Primary Columns. In this case, you can hide the actual column so that only the pseudocolumn is displayed. For example, you could specify Date: [moddt] to display the date and time a Sample was last modified (such as Date: 8/1/2003 15:36:24), but only if you have previously chosen moddt as one of the columns to be rendered.
Translate Value"Yes" translates all values in the column (see Translating Properties in section 2 (Properties Overview).
Dataset Columns Specifies attributes of the columns containing the Data Sets:
Property NameDescription
IdentifierUnique identifier for this item, rendered as an ID attribute in the HTML tag.
Column IdIdentifier for a column (in the SDIDataItem database table) containing Data Set information. In general, you would enter paramlistid as a minimum (this is the column identifier for the Data Sets).
titleText rendered on the page to identify the Column Id (above).
WidthWidth of the column in pixels.
AlignmentHorizontal alignment of values within the rendered column (left, middle, right).
ModeSpecifies how the input form control (generated HTML input tag) works. This tool automatically determines if you have chosen an appropriate mode to display the data (defined in the third column below). If not, it selects an appropriate mode. Possible values:
ValueDescriptionDesigned for use with . . .
inputEquivalent to type=text attribute of HTML input tag. As an example, this lets you use the page to add SDIs.Inputs such as the "description" column of SDCs.
readonlyEquivalent to readonly attribute of HTML input tag.All data.
hiddenEquivalent to type=hidden attribute of HTML input tag.All data.
lookupText field with capability to open "Lookup Page" and find a value of "string" data type.SDC data (such as finding SDI Ids or SDC links).
dropdownlistEquivalent to HTML select tag that inserts a select form control.SDC data and Reference Type data.
checkboxEquivalent to type=checkbox attribute of HTML input tag.Reference Type data. This works the same as it does in HTML, i.e., you need two values. Therefore, use a Reference Type having two Reference Values. The first Reference Value you specify is the "checked" value, the second is the "unchecked".
radiobutton/verticalEquivalent to type=radio attribute of HTML input tag. This arranges the radios vertically within the column.Reference Type data, generally best for choosing from more than two values.
radiobutton/horizontalEquivalent to type=radio attribute of HTML input tag. This arranges the radios horizontally within the column.
datelookupDate field with capability to open a search window and find a value of "date" data type.LabVantage "date" data type.
passwordEntry field that displays asterisks for each character you enter.Entering passwords.
Link URL Specifies attributes of a hyperlinked Column Id (above):
Property NameDescription
HRefDestination of the link, specified as a call to the Request Controller. For syntax rules and guidelines, see Request Controller and Variables.
Target Name of the window in which the linked page opens. You can enter any name here, and the new window (browser instance) will automatically assume that name. If you do not specify a target, the linked page opens in the current window.
TipPopup text displayed on mouseover.
CSS ClassClass in the CSS defined for the Layout. The default CSS is WEB-CORE/stylesheets/sapphire.css.
Lookup URLSpecifies the page used as the Lookup Page that opens when you click a hyperlinked title defined by the Link URL property (above):
Property NameDescription
HRefURL of the Lookup Page, specified as a call to the Request Controller. For syntax rules and guidelines, see Request Controller and Variables.
TipPopup text displayed on mouseover.
Display ValueSee the description of Display Value for Primary Columns.
PseudocolumnA "pseudocolumn" is a column that is rendered on the page, but does not exist in the SDC. Do not choose a database columnid when specifying a pseudocolumn. If you want to access this pseudocolumn using a JavaScript function or another pseudocolumn, specify an identifier of your own choice.

This value you enter can be HTML or a Variable. For example:

If you enter an HTML image tag, then specify a link (using the Link URL property above), the image becomes a hyperlink.
If you use a variable, the variable must point to one of the columns defined by the Column Id property for the Dataset Columns. In this case, you can hide the actual column so that only the pseudocolumn is displayed. For example, you could specify Date: [moddt] to display the date and time a Sample was last modified (such as Date: 8/1/2003 15:36:24), but only if you have previously chosen moddt as one of the columns to be rendered.
EventsJavaScript function to execute in response to an event occurring on the form control:
Property NameDescription
IdentifierUnique identifier for this item, rendered as an ID attribute in the HTML tag.
EventDHTML event that executes the JavaScript function.
JavaScriptJavaScript function to execute in response to the event. Your function can be in a *.js file referenced from the page, or in the page itself.
Translate Value"Yes" translates all values in the column (see Translating Properties in section 2 (Properties Overview).
Dataitem Columns Specifies attributes of the columns containing the Data Items for the relevant Data Set:
Property NameDescription
IdentifierUnique identifier for this item, rendered as an ID attribute in the HTML tag.
Column IdIdentifier for a column (in the SDIDataItem database table) containing Data Item information. In general, you would enter paramid as a minimum (this is the column identifier for the Parameter).
titleSee the description of title property for Dataset Columns above.
WidthSee the description of Width property for Dataset Columns above.
AlignmentSee the description of Alignment property for Dataset Columns above.
ModeSpecifies how the input form control (generated HTML input tag) works. Functionality is the same as the Mode property for Dataset Columns above.
Link URL Specifies LinkURL property for Dataset Columns above.
CSS Class See the description of CSSClass property for Dataset Columns above.
NOTE:If using WEB-OPAL/stylesheets/opal.css, set the class to dataentry_list_field_input. This sets proper borders for data fields.
Lookup PageSee the description of Lookup Page property for Dataset Columns above.
Lookup URLSee the description of Lookup URL property for Dataset Columns above.
Display ValueSee the description of Display Value for Primary Columns.
PseudocolumnA "pseudocolumn" is a column that is rendered on the page, but does not exist in the SDC. Do not choose a database columnid when specifying a pseudocolumn. If you want to access this pseudocolumn using a JavaScript function or another pseudocolumn, specify an identifier of your own choice.

This value you enter can be HTML or a Variable. For example:

If you enter an HTML image tag, then specify a link (using the Link URL property above), the image becomes a hyperlink.
If you use a variable, the variable must point to one of the columns defined by the Column Id property for the Dataitem columns. In this case, you can hide the actual column so that only the pseudocolumn is displayed. For example, you could specify Date: [moddt] to display the date and time a Sample was last modified (such as Date: 8/1/2003 15:36:24), but only if you have previously chosen moddt as one of the columns to be rendered.
EventsSee the description of Events property for Dataset Columns above.
Translate Value"Yes" translates all values in the column (see Translating Properties in section 2 (Properties Overview).
Data Entry Column Specifies attributes of the column in which you will enter data:
Property NameDescription
titleText rendered on the page to identify the Data Entry Column.
Position AfterColumn immediately preceding the Data Entry Column (enter the value of the Column Id property).
Translate Value"Yes" translates all values in the column (see Translating Properties in section 2 (Properties Overview).
Data Entry Colors Background cell color identifying the kind of data being entered:
Property NameDescription
MandatoryRequired data.
CalculationData that is the result of a LabVantage Calculation.
Specification This property lets you associate a cell color with a Spec Condition that is associated with a Specification Limit. For example, if you wanted to associate the following Spec Conditions and colors:
Spec Condition Color
FailRed
WarningOrange
PassGreen

Specify:

Fail=Red;Warning=Orange;Pass=Green;

ErrorData value that has thrown an error during processing.

This property accepts both hex colors (#FFFFFF) and browser color names (white).

EventsJavaScript function to execute in response to an event occurring in the data entry field:
Property NameDescription
IdentifierUnique identifier for this item, rendered as an ID attribute in the HTML tag.
EventDHTML event that executes the JavaScript function.
JavaScriptJavaScript function to execute in response to the event. Your function can be in a *.js file referenced from the page, or in the page itself.

Other Data Entry Features

Except where noted, the following behaviors and features apply to both dataentrylist and dataentrygrid Elements.

Data Locking

LabVantage "locks" data being accessed by another user. For current data locking strategy, see Data Locking Strategy in section 2 Properties Overview.

The dataentrylist Element also contains the Read Only property, which lets you decide whether or not to lock all data for the Element.

JavaScript Functions for Data Entry Elements

You may find the following JavaScript functions handy when dealing with Data Entry Elements.

Function Description
getSelectedPrimary() Returns the keys for all selected SDIs belonging to the primary SDC. When used with the dataentrygrid Element, if no SDIs are selected, this returns the key for the SDI in the current cell.

The character escape code %3B separates each SDI key. Example:

S-01%3BS-03%3BS-05

This function should be in WEB-CORE\elements\scripts\dataentry.js.

getSelectedPrimaryIndexes Similar to getSelectedPrimary(), but returns the HTML row numbers for the selected SDIs rather than the keys. When used with the dataentrygrid Element, if no SDIs are selected, this returns the row number relevant to the current cell.
getSelectedDatasets() Returns all keys required to describe all selected Data Sets. When used with the dataentrygrid Element, if no Data Sets are selected, this returns the key for the Data Set in the current cell.

The character escape code %3B separates each Data Set. Example:

S-01;Metals;1;1;1%3BS-03;Metals;1;1;1%3BS-05;Metals;1;1;1

This function should be in WEB-CORE\elements\scripts\dataentry.js.

getSelectedDatasetIndexes() Similar to getSelectedDatasets(), but returns the HTML row numbers for the selected SDIs rather than the keys. When used with the dataentrygrid Element, if no Data Sets are selected, this returns the row number relevant to the current cell.
getSelectedDataitems() Returns all keys required to describe all selected Data Items. When used with the dataentrygrid Element, if no Data Items are selected, this returns the key for the Data Item in the current cell.

The character escape code %3B separates each Data Item. Example:

S-01;Metals;1;1;1;Al;Standard;1%3BS-03;Metals;1;1;1;Al;Standard;1%3BS-05;Metals;1;1;1;Al;Standard;1

This function should be in WEB-CORE\elements\scripts\dataentry.js.

getSelectedDataitemIndexes() Similar to getSelectedDataitems(), but returns the HTML row numbers for the selected SDIs rather than the keys. When used with the dataentrygrid Element, if no Data Items are selected, this returns the row number relevant to the current cell.
sdiSubmitFormCommand() Generic function designed to save data on any page. However, by nesting the sdi and element tags within an sdiform tag, you can save data entered in the form by sending the value of the id attribute of the sdiform to the function:

<sapphire:button text="Save" action="sdiSubmitFormCommand( 'save', 'DEList' )"/>

<sapphire:sdiform id="DEList">

<sapphire:sdi sdcid="Sample" keyid1="S-010605-00001;S-010605-00003;S-010605-00005" request="primary[batchid.batchdesc],dataset,dataitem[keyid1.sampledesc]">

<sapphire:element elementid="DEListElement" type="dataentrylist"/>

</sapphire:sdi>

</sapphire:sdiform>

This function should be in WEB-CORE\scripts\tags.js.

getChangesMade() Returns "true" if the contents of an input field has changed; otherwise, returns "false".

This function should be in WEB-CORE\scripts\tags.js.

Data Entry Copy and Fill Features

In Data Entry Elements (as well as maint Elements), right-clicking in a cell opens a Shortcut Menu, which provides "Cut", "Copy", and "Paste" functionality. For a description, see Maintenance Grid Copy and Fill Features.

Behavior of onChange Events in Data Entry Elements

In response to an onChange event, the Data Entry Elements (as well as the maint Element) execute a default JavaScript function. You can substitute your own function, or execute yours in addition to the default function.

For the syntax required to do this, see the onchange attribute of the LabVantage Custom Tag sdiinput (LabVantage uses this tag to render HTML input form controls).

Released Data

The following behavior applies to data that have been Released:

Released data are rendered in italic.
Any controls (such as buttons) associated with entered data are disabled after the data has been Released.
Sorting

As stated in the overview of the Data Entry Elements, the sdi tag retrieves the result sets. The propsmatch attribute of the sdi tag determines the sort order of data rendered by the elements:

If propsmatch="Y", data sorts according to the order defined in the keyid1, paramlistid, paramlistversionid, variantid, and dataset attributes. The rset routines define the order and the rsetseq column is used in the sorting.
If propsmatch is not specified (or is "N"), the default or current sorting model is used: keyids are sorted in alphabetical order, followed by dataset sequence, paramlistid/version/variant, param sequence, paramid, paramtype, and replicateid.

When multiple Data Sets exist in the grid display, the keyid and dataset now defines the row grouping.

 

dataentrygrid Element

 

Description

Dataentrygrid renders a SDIs and their associated Data Sets in a grid layout. For each Data Item, this Element renders an input field for entering data.

As with the dataentrylist Element, you must render the dataentrygrid Element using an element tag in one of your own Page Types or a custom JSP (see Data Entry Overview).

Options

This Element accepts the same specialized variables and provides the same data identification features as the dataentrylist Element (see Options for the dataentrylist Element).

You can display Data Sets vertically down the left of the grid ("Test Orientation: Down"), or horizontally across the top of the grid ("Test Orientation: Across").

Examples

Test Orientation: Down

Test Orientation: Across

The following items reference the representative examples above.

Referenced Item Feature Shown
1 Primary Values retrieved from columns in the primary SDC.
2 Data Set Values retrieved from the Data Set assigned to each SDI.

If the Test Orientation is Down, the "Data Entry Column" is under each SDI.

If the Test Orientation is Across, the "Data Entry Column" is under each Data Set.

dataentrygrid Element Properties

Property Name Description
Test Orientation Specifies the grid position of Data Sets (here referred to as "Tests") in relation to their associated SDIs (which belong to the primary SDC):
Across
Displays Data Sets horizontally across the top of the grid, with the associated SDIs displayed vertically in the left-most column.
Down
Displays Data Sets vertically in the left-most column, with the associated SDIs displayed horizontally across the top of the grid.
Columns Specifies attributes of columns in the primary SDC:
Property NameDescription
IdentifierUnique identifier for this item, rendered as an ID attribute in the HTML tag.
Column IdColumn identifier for SDIs belonging to the primary SDC. For example, if the SDC is Sample, you would enter s_sampleid (minimally), and possibly other columns such as sampledesc, createdt, etc.
titleText rendered on the page to identify the Column Id (above).
Link URL Specifies attributes of a hyperlinked Column Id (above):
Property NameDescription
HRefDestination of the link, specified as a call to the Request Controller. For syntax rules and guidelines, see Request Controller and Variables.
Target Name of the window in which the linked page opens. You can enter any name here, and the new window (browser instance) will automatically assume that name. If you do not specify a target, the linked page opens in the current window.
TipPopup text displayed on mouseover.
Display ValueSee the description of Display Value for Primary Columns in the dataentrylist Element.
PseudocolumnA "pseudocolumn" is a column that is rendered on the page, but does not exist in the SDC. Do not choose a database columnid when specifying a pseudocolumn. If you want to access this pseudocolumn using a JavaScript function or another pseudocolumn, specify an identifier of your own choice.

This value you enter can be HTML or a Variable. For example:

If you enter an HTML image tag, then specify a link (using the Link URL property above), the image becomes a hyperlink.
If you use a variable, the variable must point to one of the columns defined by the Column Id property. In this case, you can hide the actual column so that only the pseudocolumn is displayed. For example, you could specify Date: [moddt] to display the date and time a Sample was last modified (such as Date: 8/1/2003 15:36:24), but only if you have previously chosen moddt as one of the columns to be rendered.
Translate Value"Yes" translates all values in the column (see Translating Properties in section 2 (Properties Overview).
Data Entry Column Specifies attributes of the column in which you will enter data:
Property NameDescription
titleText rendered on the page to identify the Data Entry Column.
Position AfterColumn immediately preceding the Data Entry Column (enter the value of the Column Id property).
Translate Value"Yes" translates all values in the column (see Translating Properties in section 2 (Properties Overview).
Data Entry ColorsSame as dataentrylist (see the description of Data Entry Colors in the dataentrylist Element.).
EventsJavaScript function to execute in response to an event occurring in the data entry field:
Property NameDescription
IdentifierUnique identifier for this item, rendered as an ID attribute in the HTML tag.
EventDHTML event that executes the JavaScript function.
JavaScriptJavaScript function to execute in response to the event. Your function can be in a *.js file referenced from the page, or in the page itself.

Additional Features

Shared Features

Dataentrygrid shares many features of the dataentrylist Element (see Other Data Entry Features in the dataentrylist Element description).

Scrolling with Selection

If a the content of a dataentrygrid is larger than the page area, scrolling the grid (horizontally or vertically) maintains the column and row headers at the top of the page.

Selecting cells by clicking and dragging causes the page to scroll automatically.