Hi,
I am building a form that consists of two components,
e.g. House and
Person. For each of these, when a new one is created I register it.
what do you register? And -- when you create new ones -- you have more
than two components? I don't quite get it ...
I have a manager class that displays these using:
That's the form?
MAToManyRelationDescription new
classes: (Array with: House);
label: 'Houses';
accessor: (MASelectorAccessor new
readSelector: #houses;
writeSelector: nil;
yourself);
default: Array new;
priority: 20;
yourself
People is similar. The Manager class is a form, but with no buttons
as it is only needed to let the add buttons work on these relation
descriptions. The accessor shown here, houses just calls "House
instances" to get currently registered houses. I subclass
MACheckedMemento and create a custom memento that simply overrides the
#push: method to see if the object is new (no members will be set) and
if so, registers the object after called "super push:".
Why don't you write your manager class manually and display the
editors for houses and persons as children? You can use the #onAnswer:
handler of the Magritte components to get notified when the user hits
add (save).
I don't quite understand why you need MAToManyRelationDescription and
a custom MACheckedMemento.
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch