1. Create a transient list object that contains a list of countries. The handle of the request is 1 because the CreateSessionObject method applies at app level. The list object contains one field named Country (defined in qFieldDefs). Alternatives values are shown in qData since qShowAlternatives is set to true. When getting the layout of the object, the first 14 values are displayed (if any). These settings are made in qInitialDataFetch.
The client sends:
{
"jsonrpc": "2.0",
"id": 1,
"method": "CreateSessionObject",
"handle": 1,
"params": [
{
"qInfo": {
"qId": "ListObject01",
"qType": "ListObject"
},
"qListObjectDef": {
"qStateName": "$",
"qLibraryId": "",
"qDef": {
"qFieldDefs": [
"Country"
],
"qFieldLabels": [
"Country Label"
],
"qSortCriterias": [
{
"qSortByLoadOrder": 1
}
]
},
"qInitialDataFetch": [
{
"qTop": 0,
"qHeight": 14,
"qLeft": 0,
"qWidth": 1
}
],
"qShowAlternatives": true
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 2
}
},
"change": [
2
]
}
The list object is created and its handle is 2. It contains a list of countries.
2. Select the country United States. This country has for element number 0. 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. Get the layout of the list object.
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "GetLayout",
"handle": 2,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"qLayout": {
"qInfo": {
"qId": "ListObject01",
"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": "A"
}
],
[
{
"qText": "Spain",
"qNum": "NaN",
"qElemNumber": 2,
"qState": "A"
}
],
[
{
"qText": "Canada",
"qNum": "NaN",
"qElemNumber": 3,
"qState": "A"
}
],
[
{
"qText": "Netherlands",
"qNum": "NaN",
"qElemNumber": 4,
"qState": "A"
}
],
[
{
"qText": "Switzerland",
"qNum": "NaN",
"qElemNumber": 5,
"qState": "A"
}
],
[
{
"qText": "France",
"qNum": "NaN",
"qElemNumber": 6,
"qState": "A"
}
],
[
{
"qText": "Belgium",
"qNum": "NaN",
"qElemNumber": 7,
"qState": "A"
}
],
[
{
"qText": "United Kingdom",
"qNum": "NaN",
"qElemNumber": 8,
"qState": "A"
}
],
[
{
"qText": "Sweden",
"qNum": "NaN",
"qElemNumber": 9,
"qState": "A"
}
],
[
{
"qText": "Hungary",
"qNum": "NaN",
"qElemNumber": 10,
"qState": "A"
}
],
[
{
"qText": "Germany",
"qNum": "NaN",
"qElemNumber": 11,
"qState": "A"
}
],
[
{
"qText": "Portugal",
"qNum": "NaN",
"qElemNumber": 12,
"qState": "A"
}
],
[
{
"qText": "Slovenia",
"qNum": "NaN",
"qElemNumber": 13,
"qState": "A"
}
]
],
"qTails": [],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 14
}
}
]
}
}
}
}
The value United States is selected.
4. Search for all values that start with P.
The client sends:
{
"jsonrpc": "2.0",
"id": 4,
"method": "SearchListObjectFor",
"handle": 2,
"params": [
"/qListObjectDef",
"P"
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 4,
"result": {
"qSuccess": true
},
"change": [
2
]
}
The search is successful.
5. Get the search results using the method GetLayout.
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": "ListObject01",
"qType": "ListObject"
},
"qMeta": {},
"qSelectionInfo": {},
"qListObject": {
"qStateName": "$",
"qSize": {
"qcx": 1,
"qcy": 1
},
"qDimensionInfo": {
"qFallbackTitle": "Country Label",
"qApprMaxGlyphCount": 14,
"qCardinal": 1,
"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": "Portugal",
"qNum": "NaN",
"qElemNumber": 12,
"qState": "A",
"qHighlightRanges": {
"qRanges": [
{
"qCharPos": 0,
"qCharCount": 1
}
]
}
}
]
],
"qTails": [],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 1
}
}
]
}
}
}
}
The search has returned one value that starts with the letter P. It is the country Portugal.
6. Accept the search results and keep the previous selections (qToggleMode:true).
The client sends:
{
"jsonrpc": "2.0",
"id": 6,
"method": "AcceptListObjectSearch",
"handle": 2,
"params": [
"/qListObjectDef",
true
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 6,
"result": {},
"change": [
2
]
}
The search results are accepted, meaning that the values that match the search are selected in the field. Previous selections are kept since the toggle mode parameter is set to true. Both the countries United States and Portugal should be in selected mode.
7. Check that the countries United States and Portugal are selected using the method GetLayout .
The client sends:
{
"jsonrpc": "2.0",
"id": 7,
"method": "GetLayout",
"handle": 2,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 7,
"result": {
"qLayout": {
"qInfo": {
"qId": "ListObject01",
"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": 2,
"qOption": 0,
"qDeselected": 0,
"qAlternative": 20,
"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": "A"
}
],
[
{
"qText": "Spain",
"qNum": "NaN",
"qElemNumber": 2,
"qState": "A"
}
],
[
{
"qText": "Canada",
"qNum": "NaN",
"qElemNumber": 3,
"qState": "A"
}
],
[
{
"qText": "Netherlands",
"qNum": "NaN",
"qElemNumber": 4,
"qState": "A"
}
],
[
{
"qText": "Switzerland",
"qNum": "NaN",
"qElemNumber": 5,
"qState": "A"
}
],
[
{
"qText": "France",
"qNum": "NaN",
"qElemNumber": 6,
"qState": "A"
}
],
[
{
"qText": "Belgium",
"qNum": "NaN",
"qElemNumber": 7,
"qState": "A"
}
],
[
{
"qText": "United Kingdom",
"qNum": "NaN",
"qElemNumber": 8,
"qState": "A"
}
],
[
{
"qText": "Sweden",
"qNum": "NaN",
"qElemNumber": 9,
"qState": "A"
}
],
[
{
"qText": "Hungary",
"qNum": "NaN",
"qElemNumber": 10,
"qState": "A"
}
],
[
{
"qText": "Germany",
"qNum": "NaN",
"qElemNumber": 11,
"qState": "A"
}
],
[
{
"qText": "Portugal",
"qNum": "NaN",
"qElemNumber": 12,
"qState": "S"
}
],
[
{
"qText": "Slovenia",
"qNum": "NaN",
"qElemNumber": 13,
"qState": "A"
}
]
],
"qTails": [],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 14
}
}
]
}
}
}
}
The countries United States and Portugal are selected. The other countries are in an alternative state.