On Wed, 19 Mar 2014 12:55:23 +0100 Julian Zwickl <[email protected]> wrote:
> Hey Guys, > > I have a question. Is it possible to disable InputFields on the run? > I want to click on a checkbox and then the InputField should be > disabled. The CheckBox and the InputField are placed on a DumbTab > widget. > > I queried the status of the CheckBox with UI.Querywidget, this works > for me. Then i tried to dis-/enable the InputField with > UI.ChangeWidget but it still doesn't work. Did you have a good > example? Maybe you can take a look( http://pastebin.suse.de/9388) > > Regards, > Julian Hi Julian, your code is slightly strange in sense of what you want achieve. My wild guess is that you need to add Opt(:notify) to checkbox, so checkbox report immediatelly if someone click on it an then you can enable/disable some widgets. Small examples are at https://github.com/yast/yast-ycp-ui-bindings/blob/master/examples/ information about notify option https://github.com/yast/yast-ycp-ui-bindings/blob/dc42d4fbeb1292ea5c06cc06604fac91bb2a13bf/doc/FAQs/notify-events.txt and one example that most demonstrate this notify that can be useful for you: https://github.com/yast/yast-ycp-ui-bindings/blob/master/examples/MultiLineEdit3.rb for your code try to 1) add Opt(:notify) to checkbox widget 2) add when statement for ":id" ( BTW I think it is bad idea to have mixture of string and symbols for ids ) 3) move line 18-28 to that case statement If you have more questions or something is not clear do not hesitate to ask again Josef -- To unsubscribe, e-mail: [email protected] To contact the owner, e-mail: [email protected]
