Get the number of entries in the back or forward stack
Get the number of entries in the:
- Back stack by using the BackCount method.
- Forward stack by using the ForwardCount method.
Example
This example begins with the creation of a list object. Some values are selected in the list object and a back action is performed. The number of entries in the back and forward stacks are retrieved. Then a forward action and a clear of all selections are performed. The number of entries in the back and forward stacks are retrieved .
-
Create a list object with the dimension (qFieldDefs) Country. The initial data fetch is composed of the first three values (qTop is 0 and qHeight is 3).
The client sends:
{ "jsonrpc": "2.0", "id": 1, "method": "CreateSessionObject", "handle": 1, "params": [ { "qInfo": { "qId": "", "qType": "ListObject" }, "qListObjectDef": { "qStateName": "$", "qLibraryId": "", "qDef": { "qFieldDefs": [ "Country" ], "qFieldLabels": [ "Country Label" ], "qSortCriterias": [ { "qSortByLoadOrder": 1 } ] }, "qInitialDataFetch": [ { "qTop": 0, "qHeight": 3, "qLeft": 0, "qWidth": 1 } ] } } ] }The engine returns:
{ "jsonrpc": "2.0", "id": 1, "result": { "qReturn": { "qType": "GenericObject", "qHandle": 2 } }, "change": [ 2 ] }The list object is created and the handle is 2.
-
Select the first two values of the list object (qValues is 0 and 1).
The client sends:
{ "jsonrpc": "2.0", "id": 2, "method": "SelectListObjectValues", "handle": 2, "params": [ "/qListObjectDef", [ 0, 1 ], false ] }The engine returns:
{ "jsonrpc": "2.0", "id": 2, "result": { "qSuccess": true }, "change": [ 2 ] }The selections are successful.
-
Go backward.
The client sends:
{ "jsonrpc": "2.0", "id": 3, "method": "Back", "handle": 1, "params": [] }The engine returns:
{ "jsonrpc": "2.0", "id": 3, "result": {} } -
Get the number of entries in the back stack.
The client sends:
{ "jsonrpc": "2.0", "id": 4, "method": "BackCount", "handle": 1, "params": [] }The engine returns:
{ "jsonrpc": "2.0", "id": 4, "result": { "qReturn": 0 } }The number of entries in the back stack is 0.
-
Get the number of entries in the forward stack.
The client sends:
{ "jsonrpc": "2.0", "id": 5, "method": "ForwardCount", "handle": 1, "params": [] }The engine returns:
{ "jsonrpc": "2.0", "id": 5, "result": { "qReturn": 1 } }The number of entries in the forward stack is 1.
-
Go forward.
The client sends:
{ "jsonrpc": "2.0", "id": 6, "method": "Forward", "handle": 1, "params": [] }The engine returns:
{ "jsonrpc": "2.0", "id": 6, "result": {}, "change": [ 1 ] } -
Get the number of entries in the back stack.
The client sends:
{ "jsonrpc": "2.0", "id": 7, "method": "BackCount", "handle": 1, "params": [] }The engine returns:
{ "jsonrpc": "2.0", "id": 7, "result": { "qReturn": 1 } }The number of entries in the back stack is 1.
-
Get the number of entries in the forward stack.
The client sends:
{ "jsonrpc": "2.0", "id": 8, "method": "ForwardCount", "handle": 1, "params": [] }The engine returns:
{ "jsonrpc": "2.0", "id": 8, "result": { "qReturn": 0 } }The number of entries in the forward stack is 0.
-
Clear all selections.
The client sends:
{ "jsonrpc": "2.0", "id": 9, "method": "ClearAll", "handle": 1, "params": [] }The engine returns:
{ "jsonrpc": "2.0", "id": 9, "result": {}, "change": [ 1 ] }The selections are cleared.
-
Get the number of entries in the back stack.
The client sends:
{ "jsonrpc": "2.0", "id": 10, "method": "BackCount", "handle": 1, "params": [] }The engine returns:
{ "jsonrpc": "2.0", "id": 10, "result": { "qReturn": 2 } }The number of entries in the back stack is 2.
-
Get the number of entries in the forward stack.
The client sends:
{ "jsonrpc": "2.0", "id": 11, "method": "ForwardCount", "handle": 1, "params": [] }The engine returns:
{ "jsonrpc": "2.0", "id": 11, "result": { "qReturn": 0 } }The number of entries in the forward stack is 0.