| 1 |
patForms RFC #0001: Context aware datasources |
|---|
| 2 |
============================================= |
|---|
| 3 |
$Id$ |
|---|
| 4 |
|
|---|
| 5 |
Author : schst |
|---|
| 6 |
Created : 2005-06-14 |
|---|
| 7 |
Status : Implemented in changeset [268] |
|---|
| 8 |
Implemented : 2005-07-31 |
|---|
| 9 |
|
|---|
| 10 |
Scope of change |
|---|
| 11 |
--------------- |
|---|
| 12 |
Datasources, which act as data providers like the Enum element should |
|---|
| 13 |
be aware of the context they are used in. This way they can be more than |
|---|
| 14 |
arrays that are created on demand. |
|---|
| 15 |
|
|---|
| 16 |
Rationale |
|---|
| 17 |
--------- |
|---|
| 18 |
* Language dependent Enum values |
|---|
| 19 |
* Values depend on other attributes of the element |
|---|
| 20 |
|
|---|
| 21 |
Functionality |
|---|
| 22 |
------------- |
|---|
| 23 |
* The elements that support datasources need to pass the element itself |
|---|
| 24 |
as the sole argument to the getValues() method or the datasource callback. |
|---|
| 25 |
This influences the following elements |
|---|
| 26 |
* Enum |
|---|
| 27 |
* Set |
|---|
| 28 |
* Combobox |
|---|
| 29 |
* RadioGroup |
|---|
| 30 |
* patForms could also provide a createDatasource() method. In order to |
|---|
| 31 |
achieve this, we should standardize the API of the datasources that ship |
|---|
| 32 |
with patForms. The easiest way probably would be passing an array to the |
|---|
| 33 |
constructor, like the Propel Datasource already does. |
|---|
| 34 |
|
|---|
| 35 |
Security considerations |
|---|
| 36 |
----------------------- |
|---|
| 37 |
* datasource may access and modify the elements |
|---|
| 38 |
|
|---|
| 39 |
Speed impact |
|---|
| 40 |
------------ |
|---|
| 41 |
None. |
|---|
| 42 |
|
|---|
| 43 |
Dependencies |
|---|
| 44 |
------------ |
|---|
| 45 |
This will at least break the existing examples. |
|---|
| 46 |
Up to now, the name of the element has been passed to the datasource, |
|---|
| 47 |
if the datasource was a callback and not a datasource object. This |
|---|
| 48 |
functionality is not documented anywhere and not used consistently in |
|---|
| 49 |
patForms, so a change would probably be a good idea. |
|---|
| 50 |
|
|---|
| 51 |
Related documents |
|---|
| 52 |
----------------- |
|---|
| 53 |
None. |
|---|
| 54 |
|
|---|
| 55 |
Comments |
|---|
| 56 |
-------- |
|---|
| 57 |
None yet. |
|---|
| 58 |
|
|---|
| 59 |
History |
|---|
| 60 |
------- |
|---|
| 61 |
$Log$ |
|---|
| 62 |
Revision 1.1 2005/06/14 16:12:51 schst |
|---|
| 63 |
started the RFC |
|---|