DisplayPageModel class | QSYS API Reference Guide
Estimated reading time: 10 minutes
Defines a specialized YellowPageModel class to provide support for fields in Records with data from the DataSet
Namespace: ASNA.QSys.Expo.Model Assembly: ASNA.QSys.Expo.Model.dll
Inheritance: Object –> PageModel –> YellowPageModel
Remarks
Record Model classes have a member instance of DisplayPageModel to provide support for data in the DataSet.
For example, the following CUSTREC
Record Model definition:
public class CUSTREC_Model : RecordModel
{
[Char(10)]
private string CSRREC
{
get => CursorLocationFormatName;
set { }
}
[Char(10)]
private string CSRFLD
{
get => CursorLocationFieldName;
set { }
}
Is the implementation for the Legacy DDS RTNCSRLOC.
With the following Legacy DDS Record specification lines:
0076.00 A R CUSTREC 080401
.
.
.
0083.00 A RTNCSRLOC(&CSRREC &CSRFLD) 080401
Which specify that the location of the Cursor (record-name and row-and-column values) should be copied to hidden fields in CUSTREC
Model class, named CSRREC
and CSRFLD
.
When a Page is posted, the DataSet is loaded with feedback information (from posted data) and the instance of DisplayPageModel is updated, such that when the Logic Project’s fields (such as CSRREC
and CSRFLD
) get populated, they will have the updated values from the recent user interaction.
Constructors
Name | Description |
---|---|
DisplayPageModel() | Initializes a new instance of the DisplayPageModel class |
DisplayPageModel()
Initializes a new instance of the DisplayPageModel class
DisplayPageModel()
Properties
Type | Name | Description |
---|---|---|
AidProperty | AttnKeys | Gets an array of AidProperty Attention values, as defined in the Page Model. Attention Aid keys do not post data. |
String | CursorLocationFieldName | Gets a value that indicating the name of field where the Cursor was last located on the Page. |
String | CursorLocationFormatName | Gets a value that indicating the name of the format where the Cursor was last located on the Page. |
AidProperty | FuncKeys | Gets an array of AidProperty Function values, as defined in the Page Model. |
Boolean | InputDataAvailable | Provides a mechanism to override the input data available state. |
String | StarDate | Gets the current day formatted as *DATE |
String | StarSystemName | Gets the System Name formatted as *SYSTEMDATE |
String | StarTime | Gets the current time formatted as *TIME |
String | StarUserName | Gets the User Name formatted as *USER |
Boolean | UserDataIsInvalid | Gets a value indicating if the data entered by user is valid. |
List<String> | ValidationErrorList | Gets a collection of validation error messages |
Boolean | ValidationErrorsFound | Gets a value indicating the existence of validation errors. |
Methods
Signature | Description |
---|---|
ApplyEditCode(Decimal, Int32, Int32, EditCodes) | Formats value according to the provided EditCode |
ApplyEditWord(Decimal, Int32, Int32, String) | Formats value according to the provided EditWord |
ClearModelProperties() | Resets all records properties to their default values. |
DumpModelPropertiesToDataSet() | Updates the Dataset byc copying the field values from the Model properties |
GetAidKeyType(AidKey) | Gets a value that represents the code for the type of Aid key. ‘A’ for attention, ‘F’ for function. |
GetDataRow(String) | Gets the first DataRow from the DataTable with the given formatName from the active DataSet. |
GetDataTable(String) | Gets the DataTable with the format name given from the active Dataset. |
GetHasBeenRead() | Gets value that indicates Workstation Dataset status |
GetLastRecordModelWritten() | Gets a value that indicates the last RecordModel written by the application logic. |
GetMessageText(String, String, Int32, String) | Gets the message text from the external message file. Message files are external XML resources. |
GetSubfileDataRow(String, Int32) | Gets the first DataRow from the DataTable with the given subfile formatName from the active DataSet. |
IsKeyEnabled(AidKey) | Gets the state of the requested AidKey. |
LoadFeedbackValues() | Populates the Feedback values on the Active DisplayFile from posted data. |
LoadModelPropertiesFromDataSet(Boolean) | Refreshes the Model properties by loading values from the active Dataset |
LoadModelStateErrors() | Populates the collection of validation errors. |
SelectMyAction(Boolean) | Selects the appropriate action to format a response Page. |
SetResponseIndicators() | Sets the response indicators in the Dataset from the Display page attributes. |
string ApplyEditCode(decimal numeric, int length, int decimals, EditCodes editCode)
Formats value according to the provided EditCode
string ApplyEditCode(decimal numeric, int length, int decimals, EditCodes editCode)
Parameters
Type | Parameter name | Description |
---|---|---|
Decimal | numeric | input decimal value |
Int32 | length | field length |
Int32 | decimals | field decimal positions |
EditCodes | editCode | EditCodes enumeration value |
Returns
Type | Description |
---|---|
String | the formatted value as string |
string ApplyEditWord(decimal numeric, int length, int decimals, string editWord)
Formats value according to the provided EditWord
string ApplyEditWord(decimal numeric, int length, int decimals, string editWord)
Parameters
Type | Parameter name | Description |
---|---|---|
Decimal | numeric | input decimal value |
Int32 | length | field length |
Int32 | decimals | field decimal positions |
String | editWord | EditWord specification |
Returns
Type | Description |
---|---|
String | the formatted value as string |
void ClearModelProperties()
Resets all records properties to their default values.
void ClearModelProperties()
void DumpModelPropertiesToDataSet()
Updates the Dataset byc copying the field values from the Model properties
void DumpModelPropertiesToDataSet()
char GetAidKeyType(AidKey key)
Gets a value that represents the code for the type of Aid key. ‘A’ for attention, ‘F’ for function.
char GetAidKeyType(AidKey key)
Parameters
Type | Parameter name | Description |
---|---|---|
AidKey | key | AidKey enumeration value |
Returns
Type | Description |
---|---|
Char | character ‘A’ for attention, ‘F’ for function |
DataRow GetDataRow(string formatName)
Gets the first DataRow from the DataTable with the given formatName from the active DataSet.
DataRow GetDataRow(string formatName)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName |
Returns
Type | Description |
---|---|
DataRow | The first DataRow. |
DataTable GetDataTable(string formatName)
Gets the DataTable with the format name given from the active Dataset.
DataTable GetDataTable(string formatName)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName |
Returns
Type | Description |
---|---|
DataTable | The DataTable |
bool GetHasBeenRead()
Gets value that indicates Workstation Dataset status
bool GetHasBeenRead()
RecordModel GetLastRecordModelWritten()
Gets a value that indicates the last RecordModel written by the application logic.
RecordModel GetLastRecordModelWritten()
string GetMessageText(string messageFileName, string messageId, int maxLength, string replacementText)
Gets the message text from the external message file. Message files are external XML resources.
string GetMessageText(string messageFileName, string messageId, int maxLength, string replacementText)
Parameters
Type | Parameter name | Description |
---|---|---|
String | messageFileName | name of message XML file. |
String | messageId | named identifier for the message to retrieve. |
Int32 | maxLength | maximum characters to copy from message text in the file, defaults to MaxValue. |
String | replacementText | data to use for replacment text place holders in message, defaults to empty. |
Returns
Type | Description |
---|---|
String | the text as string |
DataRow GetSubfileDataRow(string formatName, int RRN)
Gets the first DataRow from the DataTable with the given subfile formatName from the active DataSet.
DataRow GetSubfileDataRow(string formatName, int RRN)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | |
Int32 | RRN |
Returns
Type | Description |
---|---|
DataRow | The first DataRow. |
bool IsKeyEnabled(AidKey aidKey)
Gets the state of the requested AidKey.
bool IsKeyEnabled(AidKey aidKey)
Parameters
Type | Parameter name | Description |
---|---|---|
AidKey | aidKey | Value from enumeration indicating the key to test |
Returns
Type | Description |
---|---|
Boolean | true if the AidKey is enabled |
bool LoadFeedbackValues()
Populates the Feedback values on the Active DisplayFile from posted data.
bool LoadFeedbackValues()
void LoadModelPropertiesFromDataSet(bool onlyNonPostedFields)
Refreshes the Model properties by loading values from the active Dataset
void LoadModelPropertiesFromDataSet(bool onlyNonPostedFields)
Parameters
Type | Parameter name | Description |
---|---|---|
Boolean | onlyNonPostedFields | Determines which fields should be refreshed |
void LoadModelStateErrors()
Populates the collection of validation errors.
void LoadModelStateErrors()
IActionResult SelectMyAction(bool valid)
Selects the appropriate action to format a response Page.
IActionResult SelectMyAction(bool valid)
Parameters
Type | Parameter name | Description |
---|---|---|
Boolean | valid | indicates if the posted page passed validation |
Returns
Type | Description |
---|---|
IActionResult | Action method result |
void SetResponseIndicators()
Sets the response indicators in the Dataset from the Display page attributes.
void SetResponseIndicators()