Magriite question?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Magriite question?

John Chludzinski
I'm trying to use Magritte for a "buddy list" app.  I've defined Buddy using Magritte (i.e., using description* class-side methods).  One of the buddy attributes is userName.  When I bring up an editor for a buddy (using #addValidatedForm) I would like to be able to select a userName (from those in the system) and have the remaining attributes filled in automatically.  But each attribute is uniquely associated with a description* method and there doesn't appear to be a way to define an action (associated with selecting a userName) that would allow me to define the other buddy attribute and have them appear in the editor.

---John

descriptionUserName

    ^ MASingleOptionDescription new
        options: ((MMADatabase users collect: [ :each | each userName ]) asArray); 
        selectorAccessor: #userName;
        label: 'User Name';
        priority: 1;
        default: 'N/A';
        undefined: 'N/A';
        yourself

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Magriite question?

Lukas Renggli
>  But each attribute is uniquely associated with a description* method and
> there doesn't appear to be a way to define an action (associated with
> selecting a userName) that would allow me to define the other buddy
> attribute and have them appear in the editor.

There are different ways to get around this. MASingleOptionDescription
uses MASelectListComponent as its default view. You can for example
create a custom subclass of MASelectListComponent and select that as
the #componentClass: of your description.

Alternatively you can also compose the ready-made Magritte component
with a normal Seaside component, that provides the functionality (e.g.
a button) to add new buddies.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside