value.htm 932 B

1234567891011121314151617181920212223242526272829303132333435
  1. <%+cbi/valueheader%>
  2. <% local choices = self:choices()
  3. if choices then %>
  4. <div<%=attr("data-ui-widget", luci.util.serialize_json({
  5. "Combobox", self:cfgvalue(section) or self.default, choices, {
  6. id = cbid,
  7. name = cbid,
  8. size = self.size,
  9. sort = self.keylist,
  10. datatype = self.datatype,
  11. optional = self.optional or self.rmempty,
  12. readonly = self.readonly,
  13. maxlength = self.maxlength,
  14. placeholder = self.placeholder,
  15. custom_placeholder = self.combobox_manual
  16. }
  17. }))%>></div>
  18. <% else %>
  19. <div<%=attr("data-ui-widget", luci.util.serialize_json({
  20. "Textfield", self:cfgvalue(section) or self.default, {
  21. id = cbid,
  22. name = cbid,
  23. size = self.size,
  24. datatype = self.datatype,
  25. optional = self.optional or self.rmempty,
  26. password = self.password,
  27. readonly = self.readonly,
  28. maxlength = self.maxlength,
  29. placeholder = self.placeholder
  30. }
  31. }))%>></div>
  32. <% end %>
  33. <%+cbi/valuefooter%>