[luci] cbi .default option

Bart Van Der Meerssche bart.vandermeerssche at flukso.net
Fri Apr 22 10:10:13 CEST 2011


Hi list,

I'm coding a new cbi-modeled web page with LuCI 0.9. I would expect the 
below code to behave as follows:
1/ only show the voltage form field when the 'enable' checkbox is flagged
2/ pre-fill the voltage field with the value 230 when the field is displayed

voltage = s:option(Value, "voltage", translate("voltage"))
voltage.default = "230"
voltage:depends("enable", "1")

However, it seems only when using a form field of type ListValue that 
the .default setting has any effect. When using the Value type, nothing 
is pre-filled. The .default is listed as a Value option in the CBI 
documentation: http://luci.subsignal.org/trac/wiki/Documentation/CBI.

Is this the intended behaviour? Am I doing something wrong here?


Best regards,
Bart Van Der Meerssche.


More information about the luci mailing list