Feedback from a button callback method

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
Forum rules
This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
User avatar
berkinet
Posts: 3441
Joined: Tue Nov 18, 2008 2:08 pm
Location: Berkeley, CA, USA & Mougins, France

Feedback from a button callback method

Post by berkinet »

Is there a way to display a message from a config button's callback method? Right now I am using a readOnly textfield for that purpose. But, it is not a particularly attractive solution. In the plugin I am working on, the user clicks the "button" to read config data from a user supplied IP Address and Port on a remote device. The config data populates the remaining fields on the form. If the IP connection fails I need to tell the user. This is not a problem if the button is not used, since the regular validation routine will catch the error. But, reading the config takes place before the Save. (a little chicken and eggish)

Thanks
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Feedback from a button callback method

Post by jay (support) »

Not presently. I have the same requirement in the iTunes plugin (when a pairing attempt fails). At the moment I just show a hidden label (mine doesn't need to be dynamic) - it would be good to allow it to be red (it's on the todo list).
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
User avatar
berkinet
Posts: 3441
Joined: Tue Nov 18, 2008 2:08 pm
Location: Berkeley, CA, USA & Mougins, France

Re: Feedback from a button callback method

Post by berkinet »

Thanks for the tip (I wasn't using the iTunes plugin). I came up with the code attached below. This works for my needs, though, like you said, red would be nice. This also demonstrates the use of a textfield in visibleBindingId...
the plugin docs wrote:You can even bind it to the value in another text field, but that’s probably of limited use.

Code: Select all

	<Field id='msgControl' type='textfield' defaultValue='0'  hidden='true'>
	</Field>

	<Field id="msgTestSuccess" type="label" visibleBindingId="msgControl" visibleBindingValue="1">
		<Label>The ad2usb configuration was sucessfully read.</Label>
	</Field>
	
	<Field id="msgTestFail" type="label" visibleBindingId="msgControl" visibleBindingValue="2">
		<Label>Unable to connect to the ad2usb. Verify the connection settings and try-again.</Label>
	</Field>
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Feedback from a button callback method

Post by jay (support) »

Good use-case for using a hidden text field as a binding value.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
Locked

Return to “Extending Indigo with Plugins and Python”