Show / Hide Table of Contents

Class NSViewStateAgent

User interface view state, history, currentXXX values.

Syntax
Examples
NSViewStateAgent agent;
agent.callMethod(arg1, arg2);

Constructors

NSViewStateAgent()

User interface view state, history, currentXXX values.

Declaration
NSViewStateAgent
Examples
NSViewStateAgent agent;
agent.callMethod(arg1, arg2);

Methods

DeleteHistory(String,Integer)

Deletes the history element

Declaration
Void DeleteHistory(String historyName, Integer id)
Parameters
Type Name Description
String historyName
Integer id
Returns
Type Description
Void
Examples
NSViewStateAgent agent;
agent.callMethod(arg1, arg2);

GetCurrent(String)

Gets the current (most recent) value of the history list.

Declaration
NSHistory GetCurrent(String historyName)
Parameters
Type Name Description
String historyName
Returns
Type Description
NSHistory
Remarks

This is the item with rank = 1. If no item exists a default value is returned. This is usually the first item in the table representing the history list.

Examples
NSViewStateAgent agent;
String historyName;
NSHistory res = agent.GetCurrent(historyName);

GetHistories()

Returns all history items that belong to the currently logged in user

Declaration
NSHistory[] GetHistories()
Returns
Type Description
NSHistory[]
Examples
NSViewStateAgent agent;
NSHistory[] res = agent.GetHistories();

GetHistoriesByName(String)

Returns the named history list that belong to the currently logged in user

Declaration
NSHistory[] GetHistoriesByName(String historyName)
Parameters
Type Name Description
String historyName
Returns
Type Description
NSHistory[]
Examples
NSViewStateAgent agent;
String historyName;
NSHistory[] res = agent.GetHistoriesByName(historyName);

GetHistoriesByNames(String[])

Returns the named history lists that belong to the currently logged in user

Declaration
NSHistory[] GetHistoriesByNames(String[] historyNames)
Parameters
Type Name Description
String[] historyNames
Returns
Type Description
NSHistory[]
Examples
NSViewStateAgent agent;
String[] historyNames;
NSHistory[] res = agent.GetHistoriesByNames(historyNames);

GetHistoriesByNamesAndIds(NSHistoryRequest[])

Returns history data for the named entities and the given IDs, which may not directly correspond to the current history records in the database.Use this method if you know exactly which items you need, regardless of whether they are in the current history or not.The history in the database is not changed or even looked at by this method.

Declaration
NSHistory[] GetHistoriesByNamesAndIds(NSHistoryRequest[] requests)
Parameters
Type Name Description
NSHistoryRequest[] requests

Array of request objects that define what entities we are requesting history information for.

Returns
Type Description
NSHistory[]
Examples
NSViewStateAgent agent;
NSHistoryRequest[] requests;
NSHistory[] res = agent.GetHistoriesByNamesAndIds(requests);

GetHistory(Integer)

Gets an NSHistory object.

Declaration
NSHistory GetHistory(Integer historyId)
Parameters
Type Name Description
Integer historyId
Returns
Type Description
NSHistory
Examples
NSViewStateAgent agent;
NSHistory thing = agent.GetHistory(123);

GetHistoryLengthPrefValue()

Gets the logged-on user's preferred history list length. Will return the system preference if no user preferences are available.

Declaration
Integer GetHistoryLengthPrefValue()
Returns
Type Description
Integer
Examples
NSViewStateAgent agent;
Integer res = agent.GetHistoryLengthPrefValue();

GetNextCurrent(String,Integer)

Returns the next current item. If no item exists a default value is returned.

Declaration
NSHistory GetNextCurrent(String historyName, Integer id)
Parameters
Type Name Description
String historyName
Integer id
Returns
Type Description
NSHistory
Remarks

This is usually the first item in the table representing the history list.

Examples
NSViewStateAgent agent;
String historyName;
Integer id;
NSHistory res = agent.GetNextCurrent(historyName, id);

GetPreviousCurrent(String,Integer)

Returns the previous current item. If no item exists a default value is returned.

Declaration
NSHistory GetPreviousCurrent(String historyName, Integer id)
Parameters
Type Name Description
String historyName
Integer id
Returns
Type Description
NSHistory
Remarks

This is usually the first item in the table representing the history list.

Examples
NSViewStateAgent agent;
String historyName;
Integer id;
NSHistory res = agent.GetPreviousCurrent(historyName, id);

SaveCurrent(NSHistory)

Saves the current history item.

Declaration
NSHistory SaveCurrent(NSHistory current)
Parameters
Type Name Description
NSHistory current
Returns
Type Description
NSHistory
Remarks

This history item is saved with Rank = 1, and all the remaining elements rank values are shifted one down.

The list is maintained with the max lenght of the History list length preference.
Examples
NSViewStateAgent agent;
NSHistory current;
NSHistory res = agent.SaveCurrent(current);

SaveCurrents(NSHistory[])

Saves the history elements as the current value for their respective lists. If more than one item is submitted for the same list, they are added sequently, meaning that the last one is the most current.

Declaration
NSHistory[] SaveCurrents(NSHistory[] currents)
Parameters
Type Name Description
NSHistory[] currents
Returns
Type Description
NSHistory[]
Examples
NSViewStateAgent agent;
NSHistory[] currents;
NSHistory[] res = agent.SaveCurrents(currents);

SaveHistories(String,NSHistory[])

Replaces the existing history-list for the currently logged-in user. All elements must belong to the same history list. If not they are ignored.

Declaration
NSHistory[] SaveHistories(String historyName, NSHistory[] history)
Parameters
Type Name Description
String historyName
NSHistory[] history
Returns
Type Description
NSHistory[]
Examples
NSViewStateAgent agent;
String historyName;
NSHistory[] history;
NSHistory[] res = agent.SaveHistories(historyName, history);

SetHistoryLengthPrefValue(Integer)

Sets the logged-on user's preferred history list length.

Declaration
Void SetHistoryLengthPrefValue(Integer length)
Parameters
Type Name Description
Integer length
Returns
Type Description
Void
Examples
NSViewStateAgent agent;
agent.callMethod(arg1, arg2);
In This Article
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top