Skip to Content
0

Binding Path Syntax for JSON Models

Mar 02 at 08:49 PM

79

avatar image
Former Member

How do I specify the path to this json return?

xml.view and return JSON.

<Table
id="table"
noDataText="{worklistView>/tableNoDataText}"
updateFinished="onUpdateFinished"
mode="MultiSelect"							items="{
         path: '/d/results/Rowsets/results/Row/result'
}">

{
	"d": {
		"results": [
			{
				"DateCreated": "\/Date(1520010675000)\/",
				"EndDate": "\/Date(1520010671000)\/",
				"StartDate": "\/Date(1519967471000)\/",
				"Version": "15.0 SP9 Patch 3 (Dec 21, 2017)",
				"QueryTemplate": "Interrupcoes/TelasPortal/RegistrarInterrupcao/Query/XQry_Interrupcoes_Sel_UI5",
				"Rowset": {
					"results": [
						{
							"RowsetId": 1,
"QueryTemplate": "Interrupcoes/TelasPortal/RegistrarInterrupcao/Query/XQry_Interrupcoes_Sel_UI5",
							"Column": {
"results": [
{
"Name": "IDINTERRUPCOES",
"Description": "IDINTERRUPCOES",
"MaxRange": 1,
"MinRange": 0,
"SQLDataType": 1,
"SourceColumn": "IDINTERRUPCOES"
},
{
"Name": "DATAHORAINICIO",
"Description": "DATAHORAINICIO",
"MaxRange": 1,
"MinRange": 0,
"SQLDataType": 12,
"SourceColumn": "DATAHORAINICIO"
},
{
"Name": "DATAHORATERMINO",
"Description": "DATAHORATERMINO",
"MaxRange": 1,
"MinRange": 0,
"SQLDataType": 12,
"SourceColumn": "DATAHORATERMINO"
}
								]
							},
							"Row": {
"results": [
{
"IDINTERRUPCOES": "0a489720-e861-11e6-cc45-cd370a020132",
"DATAHORAINICIO": "01/02/2017 06:00",
"DATAHORATERMINO": "01/02/2017 06:15",
"RowId": 1
},
{
"IDINTERRUPCOES": "19809df0-e861-11e6-81c0-cd370a020132",
"DATAHORAINICIO": "01/02/2017 06:16",
"DATAHORATERMINO": "01/12/2017 09:20",
"RowId": 2
},
{
"IDINTERRUPCOES": "70b75a10-e879-11e6-8be6-cd370a020132",
"DATAHORAINICIO": "01/02/2017 09:24",
"DATAHORATERMINO": "01/02/2017 11:00",
"RowId": 3
}
								]
							}
						}
					]
				},
				"Messages": {
					"results": []
				}
			}
		]
	}
}
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Jun Wu Mar 03 at 04:23 AM
1
/d/results/0/Rowsets/results/0/Row/result

give it a try.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

I was having problems with the cache, but it worked perfectly.

Thank you very much.

items="{
      path:'/d/results/0/Rowset/results/0/Row/results'
}"

0
Nicholas Owen O’Malley Mar 05 at 07:26 AM
1

The first results is a array filled with objects. You need to specify what place in the array you want. The same goes for the second results.
This will only get the first results of the first, and the first results of the second in the path.


/d/results/0/Rowsets/results/0/Row/result

Share
10 |10000 characters needed characters left characters exceeded