The handle of the app is 1.
1. Create a list object. The list object has one dimension Country (qFieldDefs).
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": 1,
"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 has 2 as a handle.
2. Select the first value in the list object. The handle of the request is 2 because the list object has 2 as a handle.
The client sends:
{
"jsonrpc": "2.0",
"id": 2,
"method": "SelectListObjectValues",
"handle": 2,
"params": [
"/qListObjectDef",
[
0
],
false
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"qSuccess": true
},
"change": [
2
]
}
The selection is successful.
3. Retrieve the first three values (qTop is 0 and qHeight is 3) of the list object.
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "GetListObjectData",
"handle": 2,
"params": [
"/qListObjectDef",
[
{
"qTop": 0,
"qHeight": 3,
"qLeft": 0,
"qWidth": 1
}
]
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"qDataPages": [
{
"qMatrix": [
[
{
"qText": "United States",
"qNum": "NaN",
"qElemNumber": 0,
"qState": "S"
}
],
[
{
"qText": "Denmark",
"qNum": "NaN",
"qElemNumber": 1,
"qState": "X"
}
],
[
{
"qText": "Spain",
"qNum": "NaN",
"qElemNumber": 2,
"qState": "X"
}
]
],
"qTails": [],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 3
}
}
]
}
}
The value United States is selected.
4.Create a bookmark with the identifier BM01 (qId).
The client sends:
{
"jsonrpc": "2.0",
"id": 4,
"method": "CreateBookmark",
"handle": 1,
"params": [
{
"qInfo": {
"qId": "BM01",
"qType": "Bookmark"
},
"qBookmarkListDef": {
"qType": "Bookmark"
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 4,
"result": {
"qReturn": {
"qType": "GenericBookmark",
"qHandle": 3
},
"qInfo": {
"qId": "BM01",
"qType": "Bookmark"
}
},
"change": [
1,
3
]
}
The bookmark is created.
5. Clone the bookmark BM01.
The client sends:
{
"jsonrpc": "2.0",
"id": 5,
"method": "CloneBookmark",
"handle": 1,
"params": [
"BM01"
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 5,
"result": {
"qCloneId": "4521f173-180f-41f2-9402-e544b795a6d7"
}
}
The clone of the bookmark is created. Its identifier is 4521f173-180f-41f2-9402-e544b795a6d7.
6. Get the handle of the field Country. The handle of the request is 1 because the GetField method applies at app level.
The client sends:
{
"jsonrpc": "2.0",
"id": 6,
"method": "GetField",
"handle": 1,
"params": [
"Country"
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 6,
"result": {
"qReturn": {
"qType": "Field",
"qHandle": 4
}
}
}
The handle of the field is 4.
7. Clear the selections in the field Country (qHandle is 4).
The client sends:
{
"jsonrpc": "2.0",
"id": 7,
"method": "Clear",
"handle": 4,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 7,
"result": {
"qReturn": true
},
"change": [
1,
2,
4
]
}
The selections are cleared.
8. Get the first three values of the list object (qTop is 0 and qHeight is 3).
The client sends:
{
"jsonrpc": "2.0",
"id": 8,
"method": "GetListObjectData",
"handle": 2,
"params": [
"/qListObjectDef",
[
{
"qTop": 0,
"qHeight": 3,
"qLeft": 0,
"qWidth": 1
}
]
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 8,
"result": {
"qDataPages": [
{
"qMatrix": [
[
{
"qText": "United States",
"qNum": "NaN",
"qElemNumber": 0,
"qState": "O"
}
],
[
{
"qText": "Denmark",
"qNum": "NaN",
"qElemNumber": 1,
"qState": "O"
}
],
[
{
"qText": "Spain",
"qNum": "NaN",
"qElemNumber": 2,
"qState": "O"
}
]
],
"qTails": [],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 3
}
}
]
}
}
All the values are in optional state.
9. Apply the clone of the bookmark (qId is 4521f173-180f-41f2-9402-e544b795a6d7). The handle of the request is 1 because the ApplyBookmark method applies at app level.
The client sends:
{
"jsonrpc": "2.0",
"id": 9,
"method": "ApplyBookmark",
"handle": 1,
"params": [
"4521f173-180f-41f2-9402-e544b795a6d7"
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 9,
"result": {
"qSuccess": true
},
"change": [
1,
2,
4
]
}
The clone of the bookmark BM01 is applied.
10. Get the first three values of the list object.
The client sends:
{
"jsonrpc": "2.0",
"id": 10,
"method": "GetListObjectData",
"handle": 2,
"params": [
"/qListObjectDef",
[
{
"qTop": 0,
"qHeight": 3,
"qLeft": 0,
"qWidth": 1
}
]
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 10,
"result": {
"qDataPages": [
{
"qMatrix": [
[
{
"qText": "United States",
"qNum": "NaN",
"qElemNumber": 0,
"qState": "S"
}
],
[
{
"qText": "Denmark",
"qNum": "NaN",
"qElemNumber": 1,
"qState": "X"
}
],
[
{
"qText": "Spain",
"qNum": "NaN",
"qElemNumber": 2,
"qState": "X"
}
]
],
"qTails": [],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 3
}
}
]
}
}
The value United States is selected. The result is the same as when applying the bookmark BM01 .