skip to main content
OpenEdge Development: ADM Reference
Data Objects and Their Methods and Properties : Methods for DataView objects
 
Methods for DataView objects
This section lists and describes the methods for DataView objects.
addRow
This function creates a new RowObject temp-table record, initializes it, and returns a CHR(1)-separated list of values for the requested columns of the new RowObject row. The first entry in the list is a comma-separated list of the RowObject ROWID and blank values for the database RowIDs that have not been created yet.
Location: dataview.p
Parameters:  
INPUT pcViewColList AS CHARACTER
A comma‑separated list of column names that are to be displayed in the SmartDataViewer that called addRow.
Returns: CHARACTER
Notes: None
applyContextFromServer
This function applies context returned from server after a server call. It receives values returned from the service adapter's optional context.
Location: dataview.p
Parameters:  
INPUT pcContext AS CHARACTER
A CHR(4) separated paired list with attribute name and value.
Returns: LOGICAL
Notes: None
cancelRow
This function cancels an Add, Copy, or Save operation.
Location: dataview.p
Parameters: None
Returns: CHARACTER
Note: This function restores the original values of a modified row from the before-image record.
canNavigate
This function checks if this object or its children have pending updates. Uncommitted changes in children block navigation. This function returns TRUE if it finds nothing to block navigation, while isUpdatePending does the opposite.
Location: dataview.p
Parameters: None
Returns: LOGICAL
Notes:  
*This routine publishes isUpdatePending because that includes rowObjectState in the check to check the stat of children.
*Navigating objects call this function to check if an object can be navigated. Navigation objects receive updateState from the objects they navigate and must perform this check in the source of any updateComplete message. The updateComplete message can come from a branch of a data-link tree; publishing isUpdatePending checks the whole tree.
closeQuery
This function closes the query.
Location: dataview.p
Parameters: None
Returns: LOGICAL
Notes: None
colValues
This function formats into character strings (using the field format specification) a row of values from the current row of the database query for the specified column list.
Location: dataview.p
Parameters:  
INPUT pcViewColLis AS CHARACTER
A comma‑separated list of column names whose values are to be returned.
Returns: CHARACTER
Note: Passes back a CHR(1)‑separated list of formatted values preceded by the RowIdent code (a comma‑separated list of rowids of the database records from which the row is derived) as the first value in all cases.
commitTransaction
This procedure saves all data set changes, including data in children.
Location: dataview.p
Parameters: None
Notes: None
copyRow
This function creates a new RowObject temp-table record and copies all of the current row values to it. The return value of this function is a CHR(1)‑separated list of the values of the current row as specified in the input parameter pcViewColList. The first value of this return value is the RowIdent of the newly created row.
Location: dataview.p
Parameters:  
INPUT pcViewColList AS CHARACTER
A comma‑separated list of columns whose values are to be returned for the newly created row.
Returns: CHARACTER
Notes: None
createObjects
This procedure defines an object and its handles.
Location: dataview.p
Parameters: None
Note: This procedure should only be called at run time.
dataAvailable
This procedure receives dataAvailable events from the data source as well as data targets.
Location: dataview.p
Parameters:  
INPUT pcMode AS CHARACTER
Provides information about a new or changed record. Valid entries are:
*DIFFERENT — Open query.
*RESET — Open query if the foreign key changed.
*VALUE-CHANGED — Row change only, as in browse navigation.
Notes: None
deleteRow
This function submits a row for deletion. It returns FALSE if an error occurs.
Location: dataview.p
Parameters:  
INPUT pcRowIdent AS CHARACTER
The RowId of the RowObject temp-table to delete. The Unknown value (?) means delete the current row.
Returns: LOGICAL
Note: If auto-commit is on, the row is immediately returned to the database for deletion.
destroyObject
This procedure cleans up and deletes the object and its contained objects.
Location: dataview.p
Parameters: None
Notes: None
fetchBatch
This procedure transfers another batch of rows from the data provider or service to the temp-table query, without changing the current record position.
Location: dataview.p
Parameters:  
INPUT plForwards AS LOGICAL
The direction from which to retrieve the next batch of records. If TRUE, it retrieves the block of rows following the current row. If FALSE, it retrieves the block preceding the current row.
Notes:  
*This procedure runs from a browser to get another batch of rows from the database query appended to the RowObject temp-table query (when the browser scrolls to the end and not all rows have been retrieved).
*fetchBatch does some checking and sets up the proper parameters to sendRows, but sendRows is called to do the actual work.
fetchFirst
This procedure repositions the RowObject temp-table to the first record or to the row matching the QueryRowIdent property (if it has been set.) If the first record has not been fetched yet, then it calls sendRows to get the first batch of RowObject records of the data object and then repositions the RowObject Temp-Table to the first row.
Location: dataview.p
Parameters: None
Notes: None
fetchLast
This procedure repositions the RowObject query to the last row of the data set. If the last row has not yet been retrieved, then fetchLast gets the last batch of records and repositions the RowObject query to the last row.
Location: dataview.p
Parameters: None
Note: If RebuildOnReposition is FALSE and the last row has not been fetch yet, fetchLast asks for the rest of the data and appends it to the current data. If RebuildOnReposition is TRUE and the last row from the data provider or service has not been fetched yet, all temp-table records are discarded and just the last batch is fetched.
fetchNext
This procedure repositions the RowObject query to the next row. If a new batch is required to do so, then sendRows is called to get the new batch.
Location: dataview.p
Parameters: None
Notes: None
fetchPrev
This procedure repositions the RowObject query to the previous row. If a new batch is needed to do so, then it calls sendRows to get the new batch. Getting a new batch is only necessary when the RebuildOnReposition property is TRUE.
Location: dataview.p
Parameters: None
Notes: None
findRowWhere
This function finds a row and repositions to that row.
Location: dataview.p
Parameters:  
INPUT pcColumns AS CHARACTER
A comma-separated list of qualified column names.
INPUT pcValues AS CHARACTER
A CHR(1)-separated list of the corresponding values for the columns.
INPUT pcOperators AS CHARACTER
A comma-separated list of operators, one for each column/value pair:
*Blank — Defaults to (EQ).
*Slash — Used to define an alternative string operator (EQ/BEGINS, etc.).
Returns: LOGICAL
Notes: None
hasActiveAudit
This function tells the toolbar source that there is no active audit data. This function is hard coded to return FALSE.
Location: dataview.p
Parameters: None
Returns: LOGICAL
Notes:  
*This is a record level value that is used to show a tick mark on the Auditing action if the current record has auditing data.
*Overrides should be implemented if this information is available in the Business Entity.
hasActiveComments
This function tells the toolbar source that there is no active comments. This function is hard coded to return FALSE.
Location: dataview.p
Parameters: None
Returns: LOGICAL
Notes:  
*This is a record level value that is used to show a tick mark on the Comment action if the current record has comments.
*Overrides should be implemented if this information is available in the Business Entity.
hasForeignKeyChanged
This function determines whether or not the dataSource foreign fields are different from the current ForeignValues.
Location: dataview.p
Parameters: None
Returns: LOGICAL
Notes:  
*The function returns TRUE if the dataSource foreign fields are different from the current ForeignValues. If TRUE, the query needs to be reopened.
*This function is an important part of the logic used with the dataAvailable when RESET is specified.
*Uncommitted values are not considered to be a change, so the dataSource's before-image values are checked if RowObjectState is RowUpdated.
*The ForiegnKey is considered changed if the query closes.
initializeObject
This procedure initializes the DataView before the data request.
Location: dataview.p
Parameters: None
Notes:  
*Initialization of the DataView can happen before the actual data definition, data retrieval, and query opening. The definitions may arrive together with the data outside the scope of this procedure.
*When the DataView is on a container, data is retrieved as part of the container's initialization after all DataViews have been initialized.
*An override can manipulate query properties or other request related information, but should not assume that any table or field definitions are available. The startObject procedure captures the event of first time retieval of definitions as well as data, unless OpenOnInit is false.
isDataQueryComplete
This function determines whether or not the temp-table has all of the records. The function checks that there are no records in any direction from the current row left on the server.
Location: dataview.p
Parameters: None
Returns: LOGICAL
Note: You can check this function before you open the actual query.
keyWhere
This function returns a query expression with the key fields and current values.
This function is used to find a record without relying on the ROWID, for example, in the deleteRow error handling. In that case, the ProDataSet methods might have reused the ROWID of a deleted record that needs to be undeleted.
Location: dataview.p
Parameters:  
INPUT phBuffer AS HANDLE
The buffer for which to return the query expression, typically the before-image or after-image buffer.
INPUT pcQual AS CHARACTER
The qualifier for the column reference. (Optional)
Returns: CHARACTER
Notes: None
linkStateHandler
This procedure overrides the linkStateHandler in smart.p in order to run dataAvailable when a dataSource link is made active. Publishing dataAvailable enables synchronization with the data source.
Location: dataview.p
Parameters:  
INPUT pcState AS CHARACTER
Mode for the object. The valid values are:
*Add — Activate new link by subscribing to the link events of the passed object.
*Remove — Deactivate removed link by unsubscribing to the link events of the passed object.
*Active — Activate links by subscribing to the link events of the passed object.
*Inactive — Deactivate links by unsubscribing to the link events of the passed object.
INPUT phObject AS HANDLE
Object to which you want to subscribe or unsubscribe.
INPUT pcLink AS CHARACTER
Full link name pointing to the passed object. Both DataSource and Data-source are supported.
Note: While this class should never be database aware, this procedure currently checks database aware objects to avoid certain logic for objects that inherit from this class and run as superprocedures to reach the smart class.
obtainContextForServer
This function returns context to pass to the server.
Location: dataview.p
Parameters: None
Returns: CHARACTER
Note: There is no default context.
openDataQuery
This function opens the temp-table query.
Location: dataview.p
Parameters:  
INPUT pcPosition AS CHARACTER
Where to reposition after opening the query. The valid values are:
*First — Open on the first record.
*Last — Open on the last record.
*WHERE <criteria> — Open on the record matching the WHERE clause.
*STRING(Rowid) — Open on the record with this Rowid.
*""(Blank) — Open the query but do not position.
Returns: LOGICAL
Notes: None
openDataView
This function opens the DataView on data that already exists on the client.
Location: dataview.p
Parameters: None
Returns: LOGICAL
Note: This function is an integral part of the DataView start up and data management. It can also be called separately to refresh or reset visual data-targets from existing data.
openQuery
This function opens the query based on the current WHERE clause. Typically, this results in a new request for data from the data provider or service.
Location: dataview.p
Parameters: None
Returns: LOGICAL
Notes: None
openQueryAtPosition
This function opens the query based on the current QueryString and positions to the indicated row.
Location: dataview.p
Parameters: None
INPUT pcPosition AS CHARACTER
Where to reposition after opening the query. The valid values are:
*First — Open on the first record.
*Last — Open on the last record.
*WHERE <criteria> — Open on the record matching the WHERE clause.
Returns: LOGICAL
Notes: None
refreshQuery
This function refreshes the current query.
Location: dataview.p
Parameters: None
Returns: LOGICAL
Notes:  
*This function cannot refresh a query that has never been opened or closed.
*This function refreshes all dependant child queries.
refreshRow
This procedure retrieves the current values from the data provider for a row already in the temp-table.
Location: dataview.p
Parameters: None
Note: This procedure publishes dataAvailable('SAME') to cause a SmartDataViewer or Browser to display the latest values.
resetRow
This function resets the specified RowObject record’s state from modified to unmodified in a visual data target.
Location: dataview.p
Parameters:  
INPUT pcRowident AS CHARACTER
The RowObject’s ROWID. Passing in the Unknown value (?) resets the current RowObject.
Returns: LOGICAL
Note: This function is used to reset the current row from a visual object's resetRecord.
resolveBuffer
This function is the interface for generic query processing.
Location: dataview.p
Parameters:  
INPUT pcBuffer AS CHARACTER
Buffer name, qualified or unqualified.
Returns: CHARACTER
Note: This function is used by generic query processing that originally was implemented in the Query class and worked on database queries. That generic processing has now been moved up to the DataView class to also handle temp-table and ProDataSet queries.
resortQuery
This function resorts the current query locally.
Location: dataview.p
Parameters:  
INPUT pcSort AS CHARACTER
The sort expression. A blank value removes all sort information from the current query. The Unknown value (?) resets to the default sort expression.
Returns: LOGICAL
Notes:  
*See the QuerySort property for more details on the sort expression.
*If the query is closed, the passed sort expression is stored in the QueryString.
retrieveData
This function retrieves data. It passes FillBatch to the service or server.
Location: dataview.p
Parameters:  
INPUT pcMode AS CHARACTER
Where to start retrieving in relation to current batch (and typically current record). The valid values are:
*First — Retrieve FIRST batch. This value is only valid if RebuildOnRepos is enabled.
*Last — Retrieve LAST batch (This acts as APPEND if RebuildOnRepos is not enabled.)
*Next — Retrieve next batch.
*Prev — Retrieve previous batch.
*WHERE <criteria> — Opens the next record that matches the WHERE clause.
INPUT plRefresh AS LOGICAL
Whether or not to empty the temp-tables.
INPUT piNumRows AS INTEGER
The number of records to retrieve. Passing '0' (zero) reads all the data that is not already on the client. Passing the Unknown value (?) uses the value of RowsToBatch.
Returns: LOGICAL
Notes: None
rowChanged
This procedure encapsulates the events that all linked objects (data-targets and navigation-sources) subscribe to in order to reflect the current state of the object. The procedure is called on any change to a row or reposition.
Location: dataview.p
Parameters:  
INPUT pcMode AS CHARACTER
The event modifier to pass to data-targets. The possible values are as follows:
*SAME — The current record is being resent because it has been updated. This procedure ignores this value.
*VALUE–CHANGED — A target data object has changed its query position. This procedure needs to set the QueryPosition property then change pcRelative to DIFFERENT before passing it to other target procedures so that it appears as though the change occurred in this procedure.
*RESET — Resets the status and foreign fields, and refreshes visual objects and panels for all objects that are part of the data link. This option provides more functionality than SAME and less functionality that DIFFERENT. Use this option when you want to send notification about a change in the RowObject record without having to reopen all the dependent queries.
*DIFFERENT — Values for foreign fields should be reapplied.
*FIRST0NEXT, PREV, LAST— Treated the same as DIFFERENT in this version of dataAvailable.
Note: Currently, the event modifier is just passed on to the dataAvailable procedure.
Note: The valid values for pcMode change depending on the dataAvailable procedure in the subscriber.
submitData
This function submits all dataset changes to the server or service.
Location: dataview.p
Parameters: None
Returns: LOGICAL
Note: External visual callers should call commitTransaction, which does the necessary check for unsaved changes before calling this function.
submitRow
This function accepts a list of changed values for a row and ASSIGNs them, returning FALSE if any errors occur. This is done only to the RowObject temp-table. Committing the changes back to the data provider or service is a separate step, which is invoked from here if AutoCommit is set to on.
Location: dataview.p
Parameters:  
INPUT pcRowIdent AS CHARACTER
The RowObject ROWID, which is typically derived from the DataTarget’s Rowident property. The Unknown value (?) indicates the current record.
INPUT pcValueList AS CHARACTER
A CHR(1)‑separated list of alternating column names and values to be assigned.
Returns: LOGICAL
Notes: None
undoRow
This function undoes the specified RowObject record to a state of unchanged.
Location: dataview.p
Parameters:  
INPUT pcRowident AS CHARACTER
The RowObject ROWID. The Unknown value (?) indicates the current record.
Returns: LOGICAL
Notes:  
*Visual objects do not currently call this function directly.
*This function does not undo deleted rows.
undoTransaction
Procedure undoes any uncommitted changes to the RowObject table when the Undo button is pressed in the commit panel.
Location: dataview.p
Parameters: None
Note: The undoTransaction calls doUndoTrans to restore the RowObject temp-table and empty the RowObjUpd temp-table.
whereClauseBuffer
This function returns the buffer name of a WHERE clause expression. The function avoids problems with leading or double blanks in WHERE clauses.
Location: dataview.p
Parameters:  
INPUT pcWhere AS CHARACTER
The complete WHERE clause for one table, with or without the FOR keyword. The buffer name must be the second token in the where clause as in “EACH order OF Customer” or if “FOR” is specified the third token as in “FOR EACH order”.
Returns: CHARACTER
Notes: None