Use visibleBindingId with 2 values?

Posted on
Sat Nov 28, 2020 9:36 am
racarter offline
User avatar
Posts: 477
Joined: Jun 18, 2016
Location: North Yorkshire, UK

Use visibleBindingId with 2 values?

I'd like a config field to become visible if one or both of two checkbox values are true. If this is possible can anyone point me in the right direction?

Thanks in advance!

Posted on
Sat Nov 28, 2020 1:22 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Use visibleBindingId with 2 values?

You cannot define it in XML directly, but you can override the method that gets the XML values before the UI is shown. For device settings it would look something like:

Code: Select all
   def getDeviceConfigUiValues(self, pluginProps, typeId, devId):
      valuesDict = indigo.Dict(pluginProps)
      errorsDict = indigo.Dict()

      valuesDict["visibleBindingTagNameUsedInXML"] = something or something_else
      return (valuesDict, errorsDict)

Image

Posted on
Sat Nov 28, 2020 2:14 pm
racarter offline
User avatar
Posts: 477
Joined: Jun 18, 2016
Location: North Yorkshire, UK

Re: Use visibleBindingId with 2 values?

Thanks Matt :)

Posted on
Sun Nov 29, 2020 12:58 pm
jay (support) offline
Site Admin
User avatar
Posts: 18219
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Use visibleBindingId with 2 values?

Alternately, you can make the binding link to a hidden field then calculate the correct value for the hidden field in a callback. I can't recall if you can attach a callback to a checkbox change though, so you might have to change the UI controls you use (i.e. a menu with Option 1, Option 2, Option 1&2, then you definitely can do a callback when the menu changes).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Nov 29, 2020 1:15 pm
racarter offline
User avatar
Posts: 477
Joined: Jun 18, 2016
Location: North Yorkshire, UK

Re: Use visibleBindingId with 2 values?

Cool. Thanks Jay.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests

cron