Dear all,
The magritte-scriptaculous and magritte-realmemento packages allow
generated form components to dynamically change as the values or
selections made by the user change.
For example, the list of options in a SelectListComponent can be
supplied through an accessor, and the visibility of a field can be
determined by the value obtained via an accessor.
descriptionMyChoice
^ MASingleOptionDescription new
accessor: (#choice asAccessor) options: #choiceOptions;
The accessor framework has been extended to provide a clean and easy to
use means for specifying "alternate accessors for other purposes".
Other purposes supported include:
#visible:
#readonly:
#cssClass:
#tooltip:
#options:
#update:
The model class must specify a MARealMemento for this to work. The real
memento uses a real copy of the model object as a memento, so that the
memento model retains behaviour, particularly the interactions between
attributes. This allows an #isMyFieldVisible to depend upon the value of
a another field which may change. The form is re-rendered using
scriptaculous updates, if the components request it.
I have to say that what started out as a bit of an experiment has been
surprisingly successful, and I think it represents a significant step up
in the abilities of magritte.
I am about to go live in the next couple of days on my first commercial
project which uses this stuff.
best regards
Keith