[ANSWERED]ConfigUI Checkbox Description?

Posted on
Wed May 27, 2015 8:05 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

[ANSWERED]ConfigUI Checkbox Description?

In my Devices configUI, I have a field e.g.:
Code: Select all
<Field type="checkbox" id="checkboxSample" defaultValue="true">
   <Label>Checkbox:</Label>
   <Description>What's on the right side of the checkbox</Description>
</Field>
Is it possible to dynamically modify the Description from a plugin at run time and if so how? :)

Posted on
Wed May 27, 2015 9:31 am
jay (support) offline
Site Admin
User avatar
Posts: 18261
Joined: Mar 19, 2008
Location: Austin, Texas

Re: ConfigUI Checkbox Description?

It's possible. If you implement the following method in your plugin you can modify the XML directly:

Code: Select all
def getDeviceConfigUiXml(self, typeId, devId):
   if typeId in self.devicesTypeDict:
      return self.devicesTypeDict[typeId][u"ConfigUIRawXml"]
   return None


I'm showing the default implementation here - so you can get your xml by getting self.devicesTypeDict[typeId][u"ConfigUIRawXml"] then edit it to change the description and return the changed version. As you can see, the device id is also passed through in case you need to examine the device instance to see how to modify the XML.

Not pretty, but doable.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed May 27, 2015 9:51 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: [ANSWERED]ConfigUI Checkbox Description?

Thanks Jay :D

Am I correct in assuming that you can only alter the text using this method prior to the ConfigUi dialogue being displayed?

Can it be used (or is there a way) for the dialogue to be altered on a button press for example?

Posted on
Wed May 27, 2015 11:13 am
jay (support) offline
Site Admin
User avatar
Posts: 18261
Joined: Mar 19, 2008
Location: Austin, Texas

Re: [ANSWERED]ConfigUI Checkbox Description?

Correct - it can't be changed while the dialog is running, only upon load of the dialog.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests