cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Simple Mashup binding thing to gauge widget

rtaylor-3
1-Newbie

Simple Mashup binding thing to gauge widget

Greetings,

I'm going through the TWX tutorial work book. I've created 3 Vending Machins VM-TR1, VM-TR2, and VM-TR3. I want to create a mashup which contains a gauge which represents the current temperature of VM-TR1.


I've created the mashup and placed the gauge widget in the layout, but i'm not sure how to bind it to VM-TR1 CurrentTemperature property.


Seems pretty trivial, but I'm just not getting anywhere.


Can anyone point me to some documentation or guide me through this mashup exercise?


I'm using Thingworx 5.0 SP1

13 REPLIES 13

Hi Robert, You have to add twoentities for that. The first one would be the(which holdsthe Vending Machine names) and the entity name to be chosen is. Thesecond one is the(whichholds the Vending Machine properties) and the entity to be chosen is the.



Inthe Mashup,from Vending Machine Template shouldbe bound to aand thefrom Dynamic Vending Machine Templateshould be bound to the.Then theproperty from the Vending MachineTemplate must be bound to theproperty in DynamicVending Machine Template (This enables to switch the gauge readings between thevending machines). TheMashup event can be bound to theDynamic Vending Machine so that the values change automatically when switchingbetween the machines.But remember that unless you input in data, the gauge will be empty



Ok...that helps me understand things better...however, i'm not having luck with binding the All Data to the List Widget. I dragged All Data over to the Data property of the List Widget. The binding connection shows up in the connections window, but when i run the mashup, nothing displays. I know i have 3 implemented vending machines. I can prove this by invoking http://localhost:8080/Thingworx/ThingTemplates/VendingMachineTemplate/Services/GetImplementingThings?method=post which returns 3 records. I'm still not doing something right.

Ok...i am now able to display a simple list. The problem was that i hadn't configured the mashup loaded event to call the GetImplementedThings method. After configuring the mashup for this event, the vending machines load into the list.

As trivial as this sounds, there really should be a simple video tutorial on this.


Now onto configuring the gauge....



Ok....i have searched up and down and cannot find anything on DynamicXXXTemplate. There is nothing in the tutorial work book about it. I'm not sure what to create. Is there any documentation on Dynamic XXXX Templates?

Did you make sure to check the

Dynamic box

and then choose your Vending Machine Template ? When you do that, you can scroll down to the properties section (on the left) and then choose

GetProperties

. Or even type

GetProperties

in the

Select Services Filter Box.



Once again, without feeding it data, you won't be able to see anything on the Gauge.

Ok....making some progress now. I added the VendingMachingTemplate as a Dynamic data source and was able to bind the VendingMachineTemplate property 'name' to the DynamicVendingMachingTemplate property 'entity'. 

I have bound my DynamicVendingMachingTemplate property 'CurrentTemperature' to the gauge 'data'. 


However, i cannot find a SelectedRowChanged event on the mashup or list widget. 


Therefore the gauge is not responding.



The SelectedRowChanged event will be on the Dynamic Vending Machine Template entity. When you select the GetProperties header, you will be able to see the event on your bottom right.

The only event i see when i select DynamicVendingMachineTemplate GetProperties header is ServiceInvokeCompleted

Are you following a specific workbook ?



I'm going through the Thingworx 5.0 Workbook. It really falls down when it comes to describing how to create mashups and bind widgets to data. I was trying to come up with a very simple example for this. I thought that displaying a list of Vending Machines and selecting a vending machine from the list to display its current temperature would be a fairly simply exercise. So this is what i'm trying to accomplish.

I think i'm almost there...i just can't get the gauge to respond when i select a vending machine from the list. Each vending machine thing has a slightly different current temperature so it is evident that the binding is working.

adam11
5-Regular Member
(To:rtaylor-3)

Hi Robert,

Typically, the workbook is used during in-person training sessions where an instructor will demonstrate how to create

Mashups

 and bind data to widgets. For a more visual learning experience, I recommend following the introductory ThingWorx course available from PTC eLearning.


To answer your specific question, you won't use the SelectedRowsChanged

Event

, as non exists for

GetProperties()

. Instead, you'll use this same

Event

, but for the

GetImplementingThings()

Service

, which is populating the List. Then, as the selected rows change (i.e. you select entities), the

Event

 will fire and execute

GetProperties()

.


Regards,

Adam



Hi Adam....watching 

Communicating with Things using ThingWorx 5.0 (Part 2 of Introduction to ThingWorx 5.0) from PTCU eLearning. 

This is perfect and exactly what I needed.

Funny it uses a very similar exercise as the one i was trying to put together.


Thanks!



Hi Robert,

Just FYI, there are lots of very helpful videos on the Suport/Video tutorials tab.
There is a trick there, the videos you see when entering the Video Tutorial page are only a small subset from the available videos.
To display them all, delete ThingWorx from the Search box, then press Search. Now wait some seconds (5-10) and you will see that the right video list scrollbar becomes very small and you will be able to scroll through a much, much larger Videos collection.

Hope it helps,

BR,
Vladimir



Top Tags