[luci] a taboption depends on a taboption belongs to other section?

Le Tran Dat trandatnh at gmail.com
Wed Nov 26 11:53:42 CET 2014


Hi list,

To set a taboption depends on antoher taboption, normally I will do like
this

s:taboption("files", Flag, "noresolv",
    translate("Ignore resolve file")).optional = true

rf = s:taboption("files", Value, "resolvfile",
    translate("Resolve file"),
    translate("local <abbr title=\"Domain Name System\">DNS</abbr> file"))

rf:depends("noresolv", "")
rf.optional = true


===================================
However, How can I get the value of noresolv if noresolv is in different
section?
For example I changed noresolv to s1, and rf to s2 like this:

s1:taboption("files", Flag, "noresolv",
    translate("Ignore resolve file")).optional = true

rf = s2:taboption("files", Value, "resolvfile",
    translate("Resolve file"),
    translate("local <abbr title=\"Domain Name System\">DNS</abbr> file"))

rf:depends("noresolv", "")
rf.optional = true

Thanks,
Dat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsignal.org/pipermail/luci/attachments/20141126/4f96b8a2/attachment.html>


More information about the luci mailing list