Multiple Thing Template Sources in One Mashup
Hello,
I have several models of devices that each have their own unique combination of sensors. For this example, let's say I have two device models, D1 and D2.
I have two different templates, one for ModelD1 and one for ModelD2.
In a mashup, I would like to be able to be able to display all devices, regardless of type, in a list or grid. Let's assume grid because I can't figure out how to populate a list for some reason. When the use selects a device from the grid, I want to move a gauge based on what they selected.
If I had a single template it'd be easy, bind selected row from ModelD->GetImplementingThingsWithData to the gauge and all done. Since I have two templates things get a bit trickier as I can't bind two data sources to one grid (I think) and I can't bind two different data source return values to one gauge.
I can get the grid to populate with all devices by using a custom shape that I apply to all templates, call it ABCGenericShape. Then in the mashup I can get data from ABCGenericShape->GetImplementingThingsWithData and change the grid columns to just show the Thing name. That works fine however based on this model, once the user selects a row, I want to tie a sensor value to the gauge. The sensor is in a different shape.
It seems the solution here would be to have another data source called something like GetThing that takes a parameter of 'name' and returns the Thing object which I can use to display the value based on model.
So, then what I did was use a tab widget. I have a tab for D1 Devices and one for D2 Devices. Each tab has its own grid and I use the ModelD1 Template GetImplementingThingsWithData service to populate the respective table. This works fine however, I can't have two sources of selected row data going to the same gauge.
What's the best practice to solve this problem?
Thank you for any pointers you can provide,
Nick
P.S. I wish there was an in-depth tutorial/documentation on creating mash-ups. If there is, please point me that way as I'd love to understand this more fully.

