In this example, there are two list objects, one with the field Country and one with the field City.
All values of the field City are selected while only the first value is selected in the field Country.
1. Create a list object with identifier (qId) LB01. The list object has one dimension (qFieldDefs): Country. The initial data fetch is composed of the first three rows (qHeight is 3).
The client sends:
{
"jsonrpc": "2.0",
"id": 1,
"method": "CreateObject",
"handle": 1,
"params": [
{
"qInfo": {
"qId": "LB01",
"qType": "ListObject"
},
"qListObjectDef": {
"qStateName": "$",
"qLibraryId": "",
"qDef": {
"qFieldDefs": [
"Country"
],
"qFieldLabels": [
"Country Label"
],
"qSortCriterias": [
{
"qSortByLoadOrder": 1
}
]
},
"qInitialDataFetch": [
{
"qTop": 0,
"qLeft": 0,
"qHeight": 3,
"qWidth": 1
}
]
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 2
},
"qInfo": {
"qId": "LB01",
"qType": "ListObject"
}
},
"change": [
2
]
}
The list object LB01 is created and the handle of the object is 2.
2. Create a list object with identifier (qId) LB02. The list object has one dimension (qFieldDefs): City. The initial data fetch is composed of the first three rows (qHeight is 3).
The client sends:
{
"jsonrpc": "2.0",
"id": 2,
"method": "CreateObject",
"handle": 1,
"params": [
{
"qInfo": {
"qId": "LB02",
"qType": "ListObject"
},
"qListObjectDef": {
"qStateName": "$",
"qLibraryId": "",
"qDef": {
"qFieldDefs": [
"City"
],
"qFieldLabels": [
"Country Label"
],
"qSortCriterias": [
{
"qSortByLoadOrder": 1
}
]
},
"qInitialDataFetch": [
{
"qTop": 0,
"qLeft": 0,
"qHeight": 3,
"qWidth": 1
}
]
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 3
},
"qInfo": {
"qId": "LB02",
"qType": "ListObject"
}
},
"change": [
3
]
}
The list object LB02 is created and the handle of the object is 3.
3. Select all the values of the list object LB02. The handle of the request is 3 because the handle of the list object is 3.
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "SelectListObjectAll",
"handle": 3,
"params": [
"/qListObjectDef",
false
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"qSuccess": true
},
"change": [
3
]
}
The selections are successful.
4. Select the first value of the list object LB01. The handle of the request is 2 because the handle of the list object is 2.
The client sends:
{
"jsonrpc": "2.0",
"id": 4,
"method": "SelectListObjectValues",
"handle": 2,
"params": [
"/qListObjectDef",
[
0
],
false
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 4,
"result": {
"qSuccess": true
},
"change": [
2
]
}
The selection is successful.
5. Get the layout of the list object LB01.
The client sends:
{
"jsonrpc": "2.0",
"id": 5,
"method": "GetLayout",
"handle": 2,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 5,
"result": {
"qLayout": {
"qInfo": {
"qId": "LB01",
"qType": "ListObject"
},
"qMeta": {},
"qSelectionInfo": {},
"qListObject": {
"qStateName": "$",
"qSize": {
"qcx": 1,
"qcy": 22
},
"qDimensionInfo": {
"qFallbackTitle": "Country Label",
"qApprMaxGlyphCount": 14,
"qCardinal": 22,
"qSortIndicator": "A",
"qGroupFallbackTitles": [
"Country Label"
],
"qGroupPos": 0,
"qStateCounts": {
"qLocked": 0,
"qSelected": 1,
"qOption": 0,
"qDeselected": 0,
"qAlternative": 21,
"qExcluded": 0
},
"qTags": [
"$ascii",
"$text"
],
"qDimensionType": "D",
"qGrouping": "N"
},
"qExpressions": [],
"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 in the field Country.
6. Get the layout of the list object LB02.
The client sends:
{
"jsonrpc": "2.0",
"id": 6,
"method": "GetLayout",
"handle": 3,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 6,
"result": {
"qLayout": {
"qInfo": {
"qId": "LB02",
"qType": "ListObject"
},
"qMeta": {},
"qSelectionInfo": {},
"qListObject": {
"qStateName": "$",
"qSize": {
"qcx": 1,
"qcy": 7532
},
"qDimensionInfo": {
"qFallbackTitle": "Country Label",
"qApprMaxGlyphCount": 30,
"qCardinal": 7532,
"qSortIndicator": "A",
"qGroupFallbackTitles": [
"Country Label"
],
"qGroupPos": 0,
"qStateCounts": {
"qLocked": 0,
"qSelected": 5514,
"qOption": 0,
"qDeselected": 0,
"qAlternative": 0,
"qExcluded": 0
},
"qTags": [
"$text"
],
"qDimensionType": "D",
"qGrouping": "N"
},
"qExpressions": [],
"qDataPages": [
{
"qMatrix": [
[
{
"qText": "Addison",
"qNum": "NaN",
"qElemNumber": 0,
"qState": "S"
}
],
[
{
"qText": "Ivyland",
"qNum": "NaN",
"qElemNumber": 1,
"qState": "S"
}
],
[
{
"qText": "Hemet",
"qNum": "NaN",
"qElemNumber": 2,
"qState": "S"
}
]
],
"qTails": [],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 3
}
}
]
}
}
}
}
All values are selected in the field City.
7. Get the handle of the field Country.
The client sends:
{
"jsonrpc": "2.0",
"id": 7,
"method": "GetField",
"handle": 1,
"params": [
"Country"
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 7,
"result": {
"qReturn": {
"qType": "Field",
"qHandle": 4
}
}
}
The handle of the field is 4.
8. Clears all selections except the ones in the field Country. The handle of the request is 4 because the handle of the field is 4.
The client sends:
{
"jsonrpc": "2.0",
"id": 8,
"method": "ClearAllButThis",
"handle": 4,
"params": [
false
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 8,
"result": {
"qReturn": true
},
"change": [
1,
2,
3,
4
]
}
The operation is successful.
9. Get the layout of the list object LB01.
The client sends:
{
"jsonrpc": "2.0",
"id": 9,
"method": "GetLayout",
"handle": 2,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 9,
"result": {
"qLayout": {
"qInfo": {
"qId": "LB01",
"qType": "ListObject"
},
"qMeta": {},
"qSelectionInfo": {},
"qListObject": {
"qStateName": "$",
"qSize": {
"qcx": 1,
"qcy": 22
},
"qDimensionInfo": {
"qFallbackTitle": "Country Label",
"qApprMaxGlyphCount": 14,
"qCardinal": 22,
"qSortIndicator": "A",
"qGroupFallbackTitles": [
"Country Label"
],
"qGroupPos": 0,
"qStateCounts": {
"qLocked": 0,
"qSelected": 1,
"qOption": 0,
"qDeselected": 0,
"qAlternative": 21,
"qExcluded": 0
},
"qTags": [
"$ascii",
"$text"
],
"qDimensionType": "D",
"qGrouping": "N"
},
"qExpressions": [],
"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 selections are unchanged in the field Country.
10. Get the layout of the list object LB02.
The client sends:
{
"jsonrpc": "2.0",
"id": 10,
"method": "GetLayout",
"handle": 3,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 10,
"result": {
"qLayout": {
"qInfo": {
"qId": "LB02",
"qType": "ListObject"
},
"qMeta": {},
"qSelectionInfo": {},
"qListObject": {
"qStateName": "$",
"qSize": {
"qcx": 1,
"qcy": 7532
},
"qDimensionInfo": {
"qFallbackTitle": "Country Label",
"qApprMaxGlyphCount": 30,
"qCardinal": 7532,
"qSortIndicator": "A",
"qGroupFallbackTitles": [
"Country Label"
],
"qGroupPos": 0,
"qStateCounts": {
"qLocked": 0,
"qSelected": 0,
"qOption": 5514,
"qDeselected": 0,
"qAlternative": 0,
"qExcluded": 2018
},
"qTags": [
"$text"
],
"qDimensionType": "D",
"qGrouping": "N"
},
"qExpressions": [],
"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"
}
]
],
"qTails": [],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 3
}
}
]
}
}
}
}
The selections are cleared in the field City.