Ferreteria/errors/need to define ListItem Value

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search

Error text: need to define method "ListItem_Value()" for class clsDataSet, or create a descendant.

Dropdown lists in Ferreteria forms require three callbacks so that they know what the recordset should display:

  • ListItem_Value() - native value (typically an integer, but can be anything that could be used as a key)
  • ListItem_Text() - plaintext value to display
  • ListItem_Link() - formatted text to display when possible (usually when control is not in edit mode; typically a link)

Whichever object is passed to the fcFormControl_HTML_DropDown::Records() method needs to define these methods. If you're using a generic recordset class (such as DataSet), just create a descendant of that class only* and implement these methods.

*While the callback does not require a matching Table class, the practical logistics of getting the information you need to return may require it. Creating an admin link, for example, is just easier if you can re-use an existing Table class.