MAMultipleOptionDescription options from instance

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

MAMultipleOptionDescription options from instance

Phil@Work
Hi everyone,

I've just got started with Magritte and have a couple of new-bee questions.

1. I have a MAMultipleOptionDescription and the options come from sending #availableOptions to the current instance. I can't see how i would do this with #asDynamicObject

2. I have a SingleOptionDescription with a dynamic options object - can i provide a display block or how would i control what is displayed in the popup. I found an optionsAndLables but it doesn't take a dynamic object.

Does anyone know how to achieve this, or can point me to the appropriate documentation. Sorry for the simple questions.

Thanks in advance,

Phil


------------------------
Phil Blake
Information Systems
Retail Information Systems Pty Ltd
Level 2, 35 Spring Street
Bondi Junction, NSW, 2022
Cell: 0438 55 0000
Fax:  1300 747 001



IMPORTANT NOTICE: The information in this email is confidential and may also be privileged. It is for the intended recipient/s only. If you are not the intended recipient, any use or dissemination of the information and any disclosure or copying of this email is unauthorised and strictly prohibited. If you have received this email in error, please promptly inform us by reply email or telephone. You should also delete this email and destroy any hard copies produced.



_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: MAMultipleOptionDescription options from instance

Lukas Renggli
> 1. I have a MAMultipleOptionDescription and the options come from sending
> #availableOptions to the current instance. I can't see how i would do this
> with #asDynamicObject

MAMultipleOptionDescription is the same as MASingleOptionDescription
as far as retrieving the options concern.

> 2. I have a SingleOptionDescription with a dynamic options object - can i
> provide a display block or how would i control what is displayed in the
> popup. I found an optionsAndLables but it doesn't take a dynamic object.
> Does anyone know how to achieve this, or can point me to the appropriate
> documentation. Sorry for the simple questions.

I do not suggest to use #asDyanmicObject. I suggest that you override
#description on the instance side of your object and use
#optionsAndLabels: to set the possible options
(http://lukas-renggli.ch/smalltalk/magritte/faq).

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: MAMultipleOptionDescription options from instance

keith1y
In reply to this post by Phil@Work
Phil@Work wrote:

> Hi everyone,
>
> I've just got started with Magritte and have a couple of new-bee
> questions.
>
> 1. I have a MAMultipleOptionDescription and the options come from
> sending #availableOptions to the current instance. I can't see how i
> would do this with #asDynamicObject
>
> 2. I have a SingleOptionDescription with a dynamic options object -
> can i provide a display block or how would i control what is displayed
> in the popup. I found an optionsAndLables but it doesn't take a
> dynamic object.
>
> Does anyone know how to achieve this, or can point me to the
> appropriate documentation. Sorry for the simple questions.
>
> Thanks in advance,
>
> Phil
The Magritte-Scriptaculous package adds this kind of functionality, here
is a description from my image, in which the accessor has an alternate
accesor that is used to obtain the list of options.

descriptionImprintChooser
    ^MASingleOptionDescription new
        accessor: ((#imprint asAccessor) visible: #hasImprint; options:
#imprintOptions; tooltip: #imprintInfo);
        propertyAt: #labelSelector put: #chooserLabel;
        reference: WSUserImprint new;
        label: 'Imprint';
        beRequired;
        bePersistOnChange;
        priority: 140;
        yourself
       
Keith



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