Ferreteria/v2/usage/forms

From Woozle Writes Code
< Ferreteria‎ | v2‎ | usage
Revision as of 15:23, 5 April 2015 by htyp>Woozle (→‎Significant Functions: the rest of them, pretty much)
Jump to navigation Jump to search

About

Forms in Ferreteria consist of several sets of classes that work together:

  • control classes render editable (and eventually non-editable) data fields
  • field classes handle translating values between internal storage and on-disk storage (database)

The Forms classes are being rewritten from scratch; this page applies to the new version (2). Version 1 is here.

Files

Classes

  • fcForm (abstract)
    • fcForm_keyed ← fcForm
      • fcForm_DB ← fcForm_keyed
  • fcFormField
    • fcFormField_Num ← fcFormField
    • fcFormField_Time ← fcFormField
  • fcFormControl (abstract)
    • fcFormControl_HTML ← fcFormControl
      • fcFormControl_HTML_TextArea ← fcFormControl_HTML

Significant Functions

  • fcForm
    • ControlArray(<array of control objects (optional)>) - set/get all control objects
    • ControlObject(<name>,<control object (optional)>) - set/get control object for given name
    • AddField(<field object>, <control object>)
    • abstract LoadRecord()
    • abstract SaveRecord()
    • RecordValue(<name>,<value (optional)>) - set/get field value
    • RecordValues(<array of values (optional)>) - set/get all field values
    • NewValues(<array of values (optional)>) - set/get values for new records
    • ClearValues()
    • RenderControls(<edit?>)
  • fcForm_keyed
    • Get_KeyString_loaded()
    • Set_KeyString_loaded(<key string>)
    • Get_KeyString_toSave()
    • Set_KeyString_toSave(<key string>)
    • HasKey()
  • fcForm_DB
    • RecordsObject(<recordset object (optional)>) - set/get recordset object
    • RecordValues_SQL() - get array of SQL-ready record values
    • LoadRecord()
    • SaveRecord()
  • fcFormField
    • FormObject(<form object (optional)>) - set/get form object
    • NameString(<name string (optional)>) - set/get field's name
    • ValueNative(<value string (optional)>) - set/get field's internal value
    • ValueDisplay(<value string (optional)>) - set/get field's display value
    • ValueSQL(<value string (optional)>) - set/get field's SQL value
    • static Convert_DisplayToNative(<value string>)
    • static Convert_NativeToDisplay(<value string>)
    • static Convert_SQLToNative(<value string>)
    • static Convert_NativeToSQL(<value string>)
  • fcFormControl
    • FormObject(<form object (optional)>) - set/get form object
    • FieldObject(<field object (optional)>) - set/get field object
    • abstract Render(<edit?>)