Yake
February 16, 2020, 7:08pm
1
Intention is to write option "efilter1" and "efilter2" to "1" in the UCI file when "testFlag" is enabled. These options need not be displayed in LuCI web interface.
s:taboption("general", Flag, "testFlag", translate("Ignore Option"))
efilter1 = s:taboption("general",DummyValue, "filter1")
efilter1:depends("testFlag", "0")
efilter1.value= "1"
efilter2 = s:taboption("general",DummyValue, "filter2")
efilter2:depends("testFlag", "0")
efilter2.value= "1"
When this was tried, nothing was written to the UCI config.
Yake
February 17, 2020, 3:45am
2
Is there a way to get this done or not a valid scenario? Should all data that will be written to the UCI config file must be represented in UI?
jow
February 17, 2020, 7:45am
3
o = s:taboption("general", Flag, "testFlag", translate("Ignore Option"))
o.write = function(self, section_id, value)
self.map:set(section_id, "efilter1", "1")
self.map:set(section_id, "efilter2", "1")
end
o.remove = function(self, section_id)
self.map:delete(section_id, "efilter1")
self.map:delete(section_id, "efilter2")
end
Yake
February 20, 2020, 5:59am
4
Am able to write to the UCI file, but while removing - an error "attempt to call method 'delete' (a nil value)" shows up.
jow
February 20, 2020, 9:04am
5
May fault, it must be self.map:del(...)
not self.map:delete(...)
system
Closed
March 1, 2020, 9:04am
6
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.