1. Create a list object LB01. The name of the field is Country.
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": 1,
"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 a second list object LB02. The name of the field 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": 1,
"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. Enter the selection mode for the list object LB01 (qHandle is 2).
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "BeginSelections",
"handle": 2,
"params": [
"/qListObjectDef"
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 3,
"result": {}
}
The list object LB01 is in selection mode.
4. Select the value 0 (qElemNumber is 0) in the list object LB01.
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. Retrieve the values of the list object LB01 (qHandle is 2).
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": "Canada",
"qNum": "NaN",
"qElemNumber": 3,
"qState": "X"
}
],
[
{
"qText": "United Kingdom",
"qNum": "NaN",
"qElemNumber": 8,
"qState": "X"
}
],
[
{
"qText": "France",
"qNum": "NaN",
"qElemNumber": 6,
"qState": "X"
}
],
[
{
"qText": "Germany",
"qNum": "NaN",
"qElemNumber": 11,
"qState": "X"
}
]
],
"qTails": [],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 5
}
}
]
}
}
The country United States is selected (qElemNumber is 0). The other values are excluded.
6. Select some values in the second list object LB02 (qHandle is 3).
The client sends:
{
"jsonrpc": "2.0",
"id": 6,
"method": "SelectListObjectValues",
"handle": 3,
"params": [
"/qListObjectDef",
[
3,
8
],
false
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 6,
"error": {
"code": 6003,
"parameter": "",
"message": "Function not allowed on this object in app modal mode"
}
}
It is not possible to make any selections because the list object LB01 is in selection mode.
7. Accept the selections in the list object LB01 and exit the selection mode.
The client sends:
{
"jsonrpc": "2.0",
"id": 7,
"method": "EndSelections",
"handle": 2,
"params": [
true
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 7,
"result": {},
"change": [
2
]
}
8. Select some values in the second list object LB02.
The client sends:
{
"jsonrpc": "2.0",
"id": 8,
"method": "SelectListObjectValues",
"handle": 3,
"params": [
"/qListObjectDef",
[
3,
8
],
false
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 8,
"result": {
"qSuccess": true
},
"change": [
3
]
}
The selections in the list object LB02 are successful.