dataentry Elements |
|
Content |
|
|
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¶mlistid=Metals¶mlistversionid=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¶mlistid=Metals¶mlistversionid=1&variantid=1&dataset=1¶mid=Al¶mtype=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:
Also see Released Data in the section Other Data Entry Features below. |
||||||||||||||||
mandatory | Indicates whether or not data entry is mandatory:
|
||||||||||||||||
datatype | Indicates one of the standard LabVantage Data Types:
|
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.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
Primary Columns | Specifies attributes of the columns for the Primary SDC:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
Dataset Columns | Specifies attributes of the columns containing the Data Sets:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
Dataitem Columns | Specifies attributes of the columns containing the Data Items for the
relevant Data Set:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
Data Entry Column | Specifies attributes of the column in which you will enter data:
|
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):
|
||||||||||||||||||||||||||||
Columns | Specifies attributes of columns in the primary SDC:
|
||||||||||||||||||||||||||||
Data Entry Column | Specifies attributes of the column in which you will enter data:
|
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.