[luci] Dependencies and ListValue

Christian Gagneraud chris at techworks.ie
Wed Jul 4 20:29:01 CEST 2012


Hi there,

I'm trying to have a ListValue whose values presence within the list 
depends on another option (a ListValue as well).

I know, that it is suppose to work, since at least the wifi code in 
admin-full use this technique to filter out the encryption method 
depending on the wifi mode (AP, client, ...)

So this is how I'm doing:
tmp1 = section:option(ListValue, "tmp1" , translate("TMP1"))
tmp1:value("", translate("-- Please select --"))
tmp1:value("one", "One")
tmp1:value("two", "Two")

tmp2 = section:option(ListValue, "tmp2" , translate("TMP2"))
tmp2.override_depends=true -- This doesn't help!
tmp2:value("test1", "Test1", {tmp1="one"}, {tmp1="two"})
tmp2:value("test2", "Test2", {tmp1="one"})

And I would like to have no choice for tmp2 when tmp1="", 2 choices when 
tmp="one" and one choice when tmp1="two"

This is driving me mad, when I look at the wifi code (which works), i 
can't find what i'm doing wrong...

If anyone could shed some light on the dependency mechanism when it 
comes to ListValue:value(), i would greatly appreciate.

Regards,
Chris

-- 
Christian Gagneraud,
Embedded systems engineer.
Techworks Marine
1 Harbour road
Dun Laoghaire
Co. Dublin
Ireland
Tel: + 353 (0) 1 236 5990
Web: http://www.techworks.ie/



More information about the luci mailing list