Skip to main content
6-Contributor
October 10, 2022
Question

Thingworx checkbox in collection widget.

  • October 10, 2022
  • 2 replies
  • 2042 views

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,

2 replies

16-Pearl
October 10, 2022

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 🙂

 

6-Contributor
October 11, 2022

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. 

16-Pearl
October 11, 2022

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.

1-Visitor
October 10, 2022

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.