Need help with luci (CBI, lua)

Hi, i have a couple of questions and problems regarding luci/cbi.

  • whats does .optional = true actually do for a Flag/Value, other than .rmempty = true and can someone give a example when to use it?

  • does .rmempty = true do anything for Flag options?

  • i cant get the binary depends option to work, the option is always hidden
    s:taboption("general", Flag, "disable_netbios", translate("Disable Netbios")):depends("binary", "/usr/sbin/nmbd")

  • is there a way to get :depends working inside a template = "cbi/tblsection" section?

I tried to slim down my samba share options, but i cant find a way to dynamically display/hide a option inside a cbi/tblsection section. I tried to override the .render function, but than the section looks broken and i'm not sure how to refresh the page correctly in such a case.

.rmempty is used to indicate that if the value is not provided, the entry is removed from the config file
.optional indicates if the field is required or not (presence validation)

As for the :depends issue, I have not tried it with tblsection, but I have used is successful inside a tab option.
I suspec that you may need to write your own template based on tblsection. you would need to preserve the spacing as you disabled fields to keep the columns aligned

I created a new post: Cbi/tblsection under tab