[Seaside] "Injecting" options into a Magritte description

Esteban Lorenzano estebanlm at gmail.com
Tue Oct 1 10:41:00 UTC 2013


ah, yes... that looks better :)
And well, is the only way to do it, so I don't think  is hacky: you have sessions and  session-aware data... 
It is more a problem of understanding: your descriptions are not part of the model, are part of your view (in my apps I usually put them into a *MyView category). 

Esteban 


On Oct 1, 2013, at 3:47 AM, Esteban A. Maringolo <emaringolo at gmail.com> wrote:

> Answering myself...
> 
> Maybe not an elegant solution (nor a scalable one) but I found I can use the dynamic variable scoping to access the current session.
> 
> I changed my description to use:
> 
> descriptionStore
> 	<magritteDescription>
> 
> 	^MASingleOptionDescription new
> 		label: 'Store';
> 		accessor: #store;
> 		beRequired;
> 		options: self currentSession allStores;
> 		yourself
> 
> 
> #currentSession
>     ^WACurrentRequestContext value session
> 
> 
> It still smells bad, for some reason DynamicVariable's seems "hacky" to me. 
> 
> Maybe they're more clever than what I'm used to.
> 
> Regards,
> 
> 
> Esteban.
> 
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



More information about the seaside mailing list