Ferreteria/v2/usage/forms: Difference between revisions
< Ferreteria | v2 | usage
Jump to navigation
Jump to search
(the other file's classes; better layout) |
(significant functions; version 2 imminent) |
||
Line 3: | Line 3: | ||
* '''control''' classes render editable (and eventually non-editable) data fields | * '''control''' classes render editable (and eventually non-editable) data fields | ||
* '''field''' classes handle translating values between internal storage and on-disk storage (database) | * '''field''' classes handle translating values between internal storage and on-disk storage (database) | ||
Forms are in the process of being rewritten (version 2). The rest of this page applies to version 1. | |||
==Rules== | ==Rules== | ||
* Every '''control''' (clsCtrl) belongs to a '''control row''' (clsCtrls). | * Every '''control''' (clsCtrl) belongs to a '''control row''' (clsCtrls). | ||
Line 59: | Line 61: | ||
*** '''clsCtrlHTML_Rating''': HTML control for entering a rating (integer with fixed range and intervals) | *** '''clsCtrlHTML_Rating''': HTML control for entering a rating (integer with fixed range and intervals) | ||
|} | |} | ||
==Significant Functions== | |||
* clsCtrls (abstract) | |||
** function '''Ctrl({{arg|name}})''' → clsCtrl | |||
** function '''FieldsObject()''' → clsForm_recs_indexed | |||
* clsCtrl (abstract) | |||
** function '''Field()''' → clsField | |||
** function '''RowObject()''' → clsCtrls | |||
* clsFields | |||
** function '''DefaultValues()''' → array of mixed | |||
* clsField | |||
** function '''ValStore()''' → mixed | |||
** function '''ValShow()''' → string | |||
* clsCtrls → clsCtrl array | |||
* clsCtrl → |
Revision as of 01:44, 30 March 2015
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)
Forms are in the process of being rewritten (version 2). The rest of this page applies to version 1.
Rules
- Every control (clsCtrl) belongs to a control row (clsCtrls).
- Control rows can be indexed in order to allow for multi-row editing.
- clsCtrls should eventually be renamed clsCtrlRow.
- I haven't decided if there needs to be a clsForm class for containing multiple control rows.
- Indexing is optional if you're only editing one row at a time.
Pages
- changes/1: change to Save() parameters
Files
|
ClassesThe way this is organized is a little messed up; the descendants of clsCtrls handle database interaction -- but shouldn't it be the descendants of clsFields? It works reasonably well as is, but some rethinking might be a good idea, once everything is all mapped out. collections
unitary objects
|
Significant Functions
- clsCtrls (abstract)
- function Ctrl(<name>) → clsCtrl
- function FieldsObject() → clsForm_recs_indexed
- clsCtrl (abstract)
- function Field() → clsField
- function RowObject() → clsCtrls
- clsFields
- function DefaultValues() → array of mixed
- clsField
- function ValStore() → mixed
- function ValShow() → string
- clsCtrls → clsCtrl array
- clsCtrl →