Is this a useful addition?

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

Is this a useful addition?

Brian Brown-2
I added the following in my image:

MAOptionDescription>>labels: aBlock
        "Set the labels for each option by evaluating the block."
        |labels|
        labels := Dictionary new.
        self options do: [:ea | labels at: ea put: (aBlock value: ea)].
        self propertyAt: #labels put: labels.
       

so that is is used like:

descriptionProvider
        ^ (MASingleOptionDescription new)
                selectorAccessor: #provider;
                label: 'Staff';
                reference: ALStaffMember description;
                options: ALStorage rootOrg staff;
                labels: [:ea | ea fullName];
                priority: 20;
                yourself


This is very helpful for me using SingleOptions that are pointing to  
dynamic lists; is there already a way to do this without modifying  
Magritte?


- Brian


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki