A preliminary step is to create a transient list object.
1. Create a transient list object ListObject01.
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"
]
},
"qInitialDataFetch": [
{
"qTop": 0,
"qHeight": 1,
"qLeft": 0,
"qWidth": 1
}
]
},
"title": "Title for ListObject01",
"Number": 1,
"Boolean": true
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 2
}
},
"change": [
2
]
}
The list object is created and the handle is 2.
2 Add three properties to the list object. The handle of the request is 2 because the list object has 2 as a handle.
The added properties are persistent (qSoftPatch is set to the default value false).
The client sends:
{
"jsonrpc": "2.0",
"id": 2,
"method": "ApplyPatches",
"handle": 2,
"params": [
[
{
"qPath": "/title2",
"qOp": "add",
"qValue": "\"Title 2\""
},
{
"qPath": "/Number2",
"qOp": "add",
"qValue": "2"
},
{
"qPath": "/Boolean2",
"qOp": "add",
"qValue": "false"
}
]
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 2,
"result": {},
"change": [
2
]
}
The properties title2, Number2 and Boolean2 are added.
3. Get the properties of the list object.
Since the added properties are persistent, the GetProperties method can be used to retrieve the properties of the list object.
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "GetProperties",
"handle": 2,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"qProp": {
"qInfo": {
"qId": "ListObject01",
"qType": "ListObject"
},
"qMetaDef": {},
"qListObjectDef": {
"qStateName": "$",
"qDef": {
"qGrouping": "N",
"qFieldDefs": [
"Country"
],
"qFieldLabels": [
"Country Label"
],
"qSortCriterias": [
{
"qSortByLoadOrder": 1,
"qExpression": {}
}
],
"qNumberPresentations": [],
"qActiveField": 0
},
"qFrequencyMode": "N",
"qInitialDataFetch": [
{
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 1
}
],
"qExpressions": []
},
"title": "Title for ListObject01",
"Number": 1,
"Boolean": true,
"title2": "Title 2",
"Number2": 2,
"Boolean2": false
}
}
}
The new properties are displayed in the list object properties.