[Seaside] revel decoration
Diogenes Moreira
diogenes.moreira at gmail.com
Wed Mar 30 16:01:54 UTC 2011
well, I solved my problem extended WAActionCallback and using a Annoucement.
It may not be very elegant, but work.. :).
In this way I modify the decoration without generate functional dependences
in the subComponents, when I have actions
Best.
WAActionCallback class>>on: aBlock
|newBlock|
newBlock := [
WACurrentRequestContext value announce: SBAnnouncementClean.
aBlock value. ].
^ self new block: aBlock
MySession>>announcer
^ announcer ifNil:[ announcer := Announcer new].
MyComponent>>announcer
^ self session announcer.
MyComponent>>on: anAnnouncement send: aMessage to: anObject
self announcer on: anAnnouncement send: aMessage to: anObject.
MyComponent>>initialize
super initialize.
self on: SBAnnouncementClean send: #clean: to:self.
"and do other staff"
MyComponent>>clean
"here remove the decorations and do my staff"
---------- Forwarded message ----------
From: Diogenes Moreira <diogenes.moreira at gmail.com>
Date: Tue, Mar 29, 2011 at 3:04 PM
Subject: Re: [Seaside] revel decoration
To: Seaside - general discussion <seaside at lists.squeakfoundation.org>
well, in fact i'm remove the decoration, after rendering process.. is it
posible?.
I wanna use a decorator only one time.
On Tue, Mar 29, 2011 at 2:29 PM, Johan Brichau <johan at inceptive.be> wrote:
>
> On 29 Mar 2011, at 19:17, Diogenes Moreira wrote:
>
> > I don't know why, but the decorator is present at next rendering time
> for my component.
>
> afaik, adding or removing a decorator is similar to changing the state of
> the component: you should not do that while rendering.
> The component state is saved before rendering, which means state changes
> during rendering are lost.
>
> A solution can be to add/remove the decorator in an action callback (e.g.
> from the calling site of #inform: ?)
> But I'm also interested why you are dynamically adding/removing a decorator
> like that.
>
> Johan_______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20110330/0d620a5c/attachment.htm
More information about the seaside
mailing list