1. Create the first list object LB01. The name of the field (qFieldDefs) is Country. When getting the layout of the object, only the 10 first values are displayed (if any). This setting is made in qInitialDataFetch.
The client sends:
{
"jsonrpc": "2.0",
"id": 1,
"method": "CreateSessionObject",
"handle": 1,
"params": [
{
"qInfo": {
"qId": "LB01",
"qType": "ListObject"
},
"qListObjectDef": {
"qStateName": "$",
"qLibraryId": "",
"qDef": {
"qFieldDefs": [
"Country"
],
"qFieldLabels": [
"Country Label"
],
"qSortCriterias": [
{
"qSortByLoadOrder": 1
}
]
},
"qInitialDataFetch": [
{
"qTop": 0,
"qHeight": 10,
"qLeft": 0,
"qWidth": 1
}
]
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 2
}
},
"change": [
2
]
}
The list object LB01 is created and has 2 as a handle.
2. Create the second list object LB02. The name of the field (qFieldDefs) is City.
The client sends:
{
"jsonrpc": "2.0",
"id": 2,
"method": "CreateSessionObject",
"handle": 1,
"params": [
{
"qInfo": {
"qId": "LB02",
"qType": "ListObject"
},
"qListObjectDef": {
"qStateName": "$",
"qLibraryId": "",
"qDef": {
"qFieldDefs": [
"City"
],
"qFieldLabels": [
"Country Label"
],
"qSortCriterias": [
{
"qSortByLoadOrder": 1
}
]
},
"qInitialDataFetch": [
{
"qTop": 0,
"qHeight": 10,
"qLeft": 0,
"qWidth": 1
}
]
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 3
}
},
"change": [
3
]
}
The list object LB02 is created and has 3 as a handle.
3. Select the value 0 (qElemNumber is 0) in the first list object. The handle of the request is 2 because the first list object uses 2 as a handle.
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "SelectListObjectValues",
"handle": 2,
"params": [
"/qListObjectDef",
[
0
],
false
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"qSuccess": true
},
"change": [
2
]
}
Value 0 is selected, which corresponds to the country United States.
4. Select the value 0 (qElemNumber is 0) in the second list object. The handle of the request is 3 because the second list object has 3 as a handle.
The client sends:
{
"jsonrpc": "2.0",
"id": 4,
"method": "SelectListObjectValues",
"handle": 3,
"params": [
"/qListObjectDef",
[
0
],
false
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 4,
"result": {
"qSuccess": true
},
"change": [
3
]
}
Value 0 is selected, which corresponds to the city Addison.
5. Retrieve the values of the first list object. The handle of the request is 2 because the handle of the first list object is 2. It is enough to retrieve the first 5 values since the country United States has the number 0 as the element.
The client sends:
{
"jsonrpc": "2.0",
"id": 5,
"method": "GetListObjectData",
"handle": 2,
"params": [
"/qListObjectDef",
[
{
"qTop": 0,
"qLeft": 0,
"qHeight": 5,
"qWidth": 1
}
]
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 5,
"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"
}
],
[
{
"qText": "Canada",
"qNum": "NaN",
"qElemNumber": 3,
"qState": "X"
}
],
[
{
"qText": "Netherlands",
"qNum": "NaN",
"qElemNumber": 4,
"qState": "X"
}
]
],
"qTails": [],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 5
}
}
]
}
}
The country United States is selected. The other values are excluded.
6. Retrieve the values of the second list object. The handle of the request is 3 because the handle of the second list object is 3.It is enough to retrieve the first 5 values (in qPages) since the city Addison has the number 0 as the element.
The client sends:
{
"jsonrpc": "2.0",
"id": 6,
"method": "GetListObjectData",
"handle": 3,
"params": [
"/qListObjectDef",
[
{
"qTop": 0,
"qLeft": 0,
"qHeight": 5,
"qWidth": 1
}
]
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 6,
"result": {
"qDataPages": [
{
"qMatrix": [
[
{
"qText": "Addison",
"qNum": "NaN",
"qElemNumber": 0,
"qState": "S"
}
],
[
{
"qText": "Ivyland",
"qNum": "NaN",
"qElemNumber": 1,
"qState": "X"
}
],
[
{
"qText": "Hemet",
"qNum": "NaN",
"qElemNumber": 2,
"qState": "X"
}
],
[
{
"qText": "Montgomery",
"qNum": "NaN",
"qElemNumber": 3,
"qState": "X"
}
],
[
{
"qText": "Miami",
"qNum": "NaN",
"qElemNumber": 4,
"qState": "X"
}
]
],
"qTails": [],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 5
}
}
]
}
}
The city Addison is selected and the other values are excluded.
7. Clear all selections in the app. The handle of the request is 1 because the app has 1 as a handle.
The client sends:
{
"jsonrpc": "2.0",
"id": 7,
"method": "ClearAll",
"handle": 1,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 7,
"result": {},
"change": [
2,
3
]
}
8. Retrieve the values of the first list object.
The client sends:
{
"jsonrpc": "2.0",
"id": 8,
"method": "GetListObjectData",
"handle": 2,
"params": [
"/qListObjectDef",
[
{
"qTop": 0,
"qLeft": 0,
"qHeight": 5,
"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"
}
],
[
{
"qText": "Canada",
"qNum": "NaN",
"qElemNumber": 3,
"qState": "O"
}
],
[
{
"qText": "Netherlands",
"qNum": "NaN",
"qElemNumber": 4,
"qState": "O"
}
]
],
"qTails": [],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 5
}
}
]
}
}
All the values are in the optional state. All selections have been cleared.
9. Retrieve the values of the second list object.
The client sends:
{
"jsonrpc": "2.0",
"id": 9,
"method": "GetListObjectData",
"handle": 3,
"params": [
"/qListObjectDef",
[
{
"qTop": 0,
"qLeft": 0,
"qHeight": 5,
"qWidth": 1
}
]
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 9,
"result": {
"qDataPages": [
{
"qMatrix": [
[
{
"qText": "Addison",
"qNum": "NaN",
"qElemNumber": 0,
"qState": "O"
}
],
[
{
"qText": "Ivyland",
"qNum": "NaN",
"qElemNumber": 1,
"qState": "O"
}
],
[
{
"qText": "Hemet",
"qNum": "NaN",
"qElemNumber": 2,
"qState": "O"
}
],
[
{
"qText": "Montgomery",
"qNum": "NaN",
"qElemNumber": 3,
"qState": "O"
}
],
[
{
"qText": "Miami",
"qNum": "NaN",
"qElemNumber": 4,
"qState": "O"
}
]
],
"qTails": [],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 5
}
}
]
}
}
All the values are in the optional state. All selections have been cleared.