Skip to main content
Oct 10, 2022 12:23 PM UTC
Question

Thingworx checkbox in collection widget.

Hi there,

 

I am new to Thingworx, I have created a Mashup which contains a collection control, within that collection control I have added a mashup of a checkbox. My requirement is to check only checkbox within collection (Like radio button). I have tried different ways but couldn't achieve it. Like I added a checkbox on parent mashup and passed child mashup checkbox state which affects all checkbox's state within collection. Any idea would be appreciated.

 

Thanks,

5 replies

Oct 10, 2022 1:08 PM UTC

If I understand correctly you have one collection mashup which should have a different state depending on some criteria.

  • You can add 'MashupPropertyBinding' (see CollectionWidget) where you can specify mashupParameters which are passed to the collection mashups. the value can differ for each mashup of the collection. The mashup you use in the collection will have to have a mashup parameter with the name specified.

or

  • in the collection mashup you call a service which returns the state of this collection mashup (may not be to efficient)

Let me know if you know what I mean 🙂

 

Oct 11, 2022 10:22 AM UTC

Thanks for replying @nmutter,

 

Requirement is to populate items as checkbox list in collection widget like below which I have done.

CollectionWidget.png

Now the problem is to make these checkboxes work like radio button (Only one should be selected). As far as I know all child mashups render independently and have no direct link with each other. If I trigger an event it also triggers for itself too. I couldn't built a workable logic yet. 

Oct 11, 2022 10:41 AM UTC

I see.

Can't you use the RadioButton widget using the "Radiogroup" to group the buttons? This should work with or without collection widget (the radiogroup is used in the whole UI). You would then need to react on the isSelected=true change to know which one the user has selected for your logic.

Oct 10, 2022 3:55 PM UTC

You can try enabling AllowSelection, disabling MultiSelection and use the CellMashupSelectedField to specify a mashup parameter which will drive the checkbox state. Note that as the checkboxes themselves will display the selection state, users will be able to use the entire cell area to check or uncheck the checkboxes. You may want to disable those checkboxes and only have them readonly.