Luci (not II) display ListValue if Flag set

Hi; Been struggling with this for several days. Frustratingly simple. Must be missing something very basic.
Attempting to replace luci-app-acme for DNS mode (required for wildcard certs), select DNS service and export service dependent environment variables for acme,sh.

usedns = s:option(Flag, "usedns", translate("USE DNS")) -- check to use acme DNS mode
x = s:option(ListValue, "DNS_Service", translate("DNS Service")) -- dropdown select with list of DNS services
x:depends("usedns", '1')

I have successfully uses depends on another ListValue field setting for a ListValue, but have been unsuccessful using Flags for depends.

I have debug dumped the Flag object with no evidence of what field represents checked / unchecked

Intent is to (@ render) immediately display the list value when checked, do not display when unchecked.

All code I have inspected uses Flags to control tab display, none to control AbstractValue field display.


Turns out that section s template was the issue:

s = m:section(TypedSection, "certificate", translate("Certificates"))
-- certificate is the section called "certificate" in config file
s.addremove = true
s.sectionhead = translate("Certificate Name")
-- Template kills depends
--s.template = "cbi/tblsection"

cbi/tblsection.htm needs to be altered to consider depends. For now will not use template.

Open to suggestions for altering cbi/tblsection.htm to use .depends


This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.