View unanswered posts | View active topics It is currently Sun May 19, 2013 7:58 pm



Reply to topic  [ 4 posts ] 
 Feedback from a button callback method 
Author Message
User avatar

Joined: Nov 18, 2008
Posts: 1720
Location: Berkeley, CA
Post Feedback from a button callback method
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


Tue Dec 20, 2011 1:13 am
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6642
Location: Austin, Texas
Post Re: Feedback from a button callback method
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)
Image


Tue Dec 20, 2011 6:51 am
Profile WWW
User avatar

Joined: Nov 18, 2008
Posts: 1720
Location: Berkeley, CA
Post Re: Feedback from a button callback method
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>


Tue Dec 20, 2011 10:47 am
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6642
Location: Austin, Texas
Post Re: Feedback from a button callback method
Good use-case for using a hidden text field as a binding value.

_________________
Jay (Indigo Support)
Image


Tue Dec 20, 2011 11:31 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.   Template designed by STSoftware.