| 1 |
Attribute Filters: |
|---|
| 2 |
------------------ |
|---|
| 3 |
|
|---|
| 4 |
$Id$ |
|---|
| 5 |
|
|---|
| 6 |
Like filters that manipulate an element's value, attribute filter are |
|---|
| 7 |
capable to alter element's attributes. Such a filter can by applied to |
|---|
| 8 |
an element and to form. Well, a form is nothing more than a bunch of |
|---|
| 9 |
elements in this case. |
|---|
| 10 |
|
|---|
| 11 |
In case more than one attribute filter was applied to an element, all |
|---|
| 12 |
of them will be executed - in the same order as they were added. In other |
|---|
| 13 |
words, each filter might recieve a value which has already been altered |
|---|
| 14 |
by one or more filters before. |
|---|
| 15 |
|
|---|
| 16 |
The applied filters will be executed based on events. Hence the attribute |
|---|
| 17 |
filter base class implements methods named "on[SOMEEVENT]" which must be |
|---|
| 18 |
overwritten by the concreate attribute filter to actually do something. |
|---|
| 19 |
|
|---|
| 20 |
So far, attribute filters support two events: "apply" and "set", hence they |
|---|
| 21 |
implement the member functions: "onApply" and "onSet". |
|---|
| 22 |
|
|---|
| 23 |
Set Event |
|---|
| 24 |
--------- |
|---|
| 25 |
Each time an element's attribute is set the "onSet" function will be called. |
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
Apply Event |
|---|
| 29 |
----------- |
|---|
| 30 |
The apply event happens as soon as an attribute filter was added to an |
|---|
| 31 |
element. In other words, the "onApply" function is executed. |
|---|
| 32 |
|
|---|
| 33 |
One might think, that this event is quite unnecessary. Because the attributes |
|---|
| 34 |
will be initually set, the "set" event happens at time of element creation. Yes, |
|---|
| 35 |
it is true, that the "set" event happens. Unfortunately there can't be any |
|---|
| 36 |
attribute filters at this stage of an element's life cycle. What happens is that |
|---|
| 37 |
elements are created first and filters added later. |
|---|
| 38 |
|
|---|