Page 1 of 1

Webservice Data Url

Posted: Wed Nov 19, 2014 3:45 am
by m400mail
Hello *all,

if there an example for the data Webservice url ? ( Option data url from the Grid properties )
I want to create a dynamic Grid withy dynamic Fields (Coloumns) .

Thanks for your help
Michael

Re: Webservice Data Url

Posted: Wed Nov 19, 2014 10:57 am
by Scott Klement
The data url can be used to populate the data in the grid. This does not, however, allow the columns to be dynamic -- unless I'm misunderstanding what you mean by this?

The "number of columns" property determines the number of columns, and Profound UI will use this to draw the grid. Then, after the grid has been drawn, it will call the web service to get the data to put into the grid cells. The web service data cannot change the number of columns... it is already set at the point when the web service is called.

Do you still want an example?

Re: Webservice Data Url

Posted: Wed Nov 19, 2014 10:59 am
by Scott Klement
there is a discussion and example of the data url here:
http://www.profoundlogic.com/forum/view ... =53&t=1561

Re: Webservice Data Url

Posted: Wed Nov 19, 2014 11:34 am
by m400mail
For example:
i want to call a program tha sent JSON data back to my Profound Grid .
JSON 1
({success:true,data:{
[{applic:CVTOSDB,count:35,entries:[
{"id":"1","KDLAND":"AL","KDORT":"TIRANA-ALBANIEN","KDSTRA":"TREGT.UNIV.AUTOSTRAD"},
{"id":"2","KDLAND":"AL","KDORT":"TIRANA-ALBANIA","KDSTRA":"AUTOSTRADA TR-DR"},
{"id":"3","KDLAND":"AL","KDORT":"FIER-ALBANIA","KDSTRA":"BULEV. AULONA KM 0.7"},
{"id":"4","KDLAND":"AL","KDORT":"TIRANA-ALBANIA","KDSTRA":"\"ISMAIL QEMALI\""},
{"id":"5","KDLAND":"AL","KDORT":"VLORE-ALBANIA","KDSTRA":"RR. \"KOSOVA\""},
......
]}
]}})

JSON 2
({success:true,data:{[
{applic:CVTOSDB,count:30,entries:[
{"id":"1","KDLAND":"AL","KDORT":"TIRANA-ALBANIEN"},
{"id":"2","KDLAND":"AL","KDORT":"TIRANA-ALBANIA"},
{"id":"3","KDLAND":"AL","KDORT":"FIER-ALBANIA"},
{"id":"4","KDLAND":"AL","KDORT":"VLORE-ALBANIA"},
......
]}
]}})

the JSON data are creates with a tool on the IBM i

so i want to put the data into the same Grid . if there a way to do this without to define any columns on the grid ?

michael

Re: Webservice Data Url

Posted: Wed Nov 19, 2014 11:58 am
by Scott Klement
Sorry, no. The format of the grid is defined in the display file. The JSON is only for the data that goes into the grid -- it cannot change the format.