Hi folks … Yesterday I gave a presentation about the new REST Client Library in Breda (The Netherlands). I have prepared a little iOS demo application which uses the Strava REST API. I'm trying to make it better so I can upload it and share the sources, but I have a little question for the Firemonkey / Livebindings experts.

Hi folks … Yesterday I gave a presentation about the new REST Client Library in Breda (The Netherlands). I have prepared a little iOS demo application which uses the Strava REST API. I'm trying to make it better so I can upload it and share the sources, but I have a little question for the Firemonkey / Livebindings experts.

I have a TListView which is bound to a ClientDataSet using LiveBindings. I have set it up so that the Item.Text displays the name of an Activity and the Item.LookupData points to the Id of an Activity.

Now I was hoping to be able to get a hold of that Lookup value (the value of the ID) for the item the user clicked. Sadly in the OnItemClick even of my ListView I can't seem to figure out how to get the value of the ID for the clicked item. The AItem has a .Text value which I can use, but no .LookupData. I can us the .Text to do a locate in my DataSet, but that isn't 100% safe since there might be a lot of activities with the same name. Additionally it requires some performance which I think isn't necessary since I thought the id would be stored with the ListViewItem somehow.

Does anyone know how I can 'Fix' that ? How can I get the value which is bound to the LookupData of the Item ? I need to get that ID, because it is a parameter of a REST Request to get the detailed info for that Activity. Any suggestions ?

Thanks a lot in advance.

Oh … I added some sample pics of the demo apps (built using the same Strava REST Client API code, but one is iOS other is VCL using DevExpress components ).



Comments

  1. For people know knowing about Strava: http://www.strava.com/ it is a tracker for running and cycling.

    ReplyDelete
  2. True … thought I had added a link to it … Actually made a similar demo for RunKeeper too … but keeping that for another Workshop :-P

    ReplyDelete

Post a Comment