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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Where do the options in Dependent Field come from?

rwiseman
1-Newbie

Where do the options in Dependent Field come from?

When adding State Formatting to a widget (I'm using a Gauge) you have to specify the "Dependent Field" to use.  I would have expected this to be (or at least default to) the value that the widget is displaying (i.e. the property bound to the widget's Data field) but it doesn't.  It seems to show a list of all the properties of the entity from which the widget gets its value.  This seems slightly unintuitive to me.  Does anyone know the logic behind this?  Am I correct in my assumption of where the list comes from?  If you haven't bound the widget's data, you can't add State Formatting, so that seems to corroborate my assumption.  I think the other reason I'm confused is that once I've chosen a Dependent Field, I would expect that to be shown in the Connections panel - especially if it's not the same as the widget's Data field - but it's not.

1 ACCEPTED SOLUTION

Accepted Solutions
Aanjan
9-Granite
(To:rwiseman)

Well, the logic behind populating the dependent fields is get all properties; hence that's why all properties show up. This might make sense from a custom widget standpoint; as you can create and use a custom widget, the availability of all properties would not hinder its functionality in any way. For the second question, did you mean displaying the chosen dependent field once you select that in the styles menu?

View solution in original post

8 REPLIES 8
Aanjan
9-Granite
(To:rwiseman)

Richard, you are right, those are all the properties the widget has. The 'Depended Field' in the State-based Formatting section outputs all properties regardless of the widget (you may find description/ name in that section for a Gauge widget). By Connections panel, can you give me more information on what you are referring to?

Thanks for the response.  It sounds like you're saying the properties are the widget's properties, not the properties of the entity that the widget's data is bound to -- is that correct?  If so, how come the widget contains all the properties of the entity from which it gets its data?

When I say "Connections Panel" I mean the middle section at the bottom of the mashup builder where it shows data and event bindings.

Aanjan
9-Granite
(To:rwiseman)

Sorry, I meant the widget displays all the properties that is part of the Thing regardless of the widget functionality. That's why I had pointed out the description property of a Thing can be selected in a Gauge widget, even though you wouldn't use it there.

Thanks again.  And are you able to comment on the two sub-questions (one explicit, one implicit!) that I sneaked into my original post?

  1. What is the logic behind making all the entity's properties available to be the Dependent Field?  (I'm struggling to see an application for creating a Numeric Range style based upon something other than the widget's value!)
  2. How come the Connections Panel doesn't show the entity field that is being used to style the widget?  I think this should particularly be shown if it's a different field to that used for the widget's value.

It's just for my understanding really: if I can't see the reason for something, it makes me wonder what else I won't understand!

Aanjan
9-Granite
(To:rwiseman)

Well, the logic behind populating the dependent fields is get all properties; hence that's why all properties show up. This might make sense from a custom widget standpoint; as you can create and use a custom widget, the availability of all properties would not hinder its functionality in any way. For the second question, did you mean displaying the chosen dependent field once you select that in the styles menu?

Thanks.

And yes, since the connections panel shows (as I understand it) how entities are linked (i.e. what events trigger what actions and what properties are bound together), it would make sense for the dependent field to appear in the connections panel.

Aanjan
9-Granite
(To:rwiseman)

We could possibly have another tab, next to the To-Do tab, for dependent fields. I can possibly check with few devs here if that would make sense as an improvement or a new feature request. Thanks!

Thanks, I think that would be useful!

Top Tags