<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>if it's for the sake of making it work all is valid</div><div><br></div><div>otherwise that sounds a bit extreme for something you just need to do once</div><div><br></div><div>besides, why justify a hack when you can compose a normal component and make it react properly (and remove the wrapper or change its state normally from a callback)</div><div><br></div><div>(note this is aimed to talk about good practices not to slow you down)</div><div><br></div><div><br></div><div><br><div><br><div><div>On Mar 30, 2011, at 1:01 PM, Diogenes Moreira wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">well, I solved my problem extended WAActionCallback and using a Annoucement.<br><br>It may not be very elegant, but work.. :).<br><br>In this way I modify the decoration without generate functional dependences in the subComponents, when I have actions<br>
<br>Best.<br><br><br>WAActionCallback class&gt;&gt;on: aBlock<br>&nbsp;&nbsp;&nbsp; |newBlock|<br>&nbsp;&nbsp;&nbsp; newBlock := [ <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; WACurrentRequestContext value announce: SBAnnouncementClean.<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; aBlock value. ].<br>&nbsp;&nbsp;&nbsp; ^ self new block: aBlock<br>
<br>MySession&gt;&gt;announcer<br>&nbsp;&nbsp;&nbsp; ^ announcer ifNil:[ announcer := Announcer new].<br><br>MyComponent&gt;&gt;announcer<br>&nbsp;&nbsp;&nbsp; ^ self session announcer.<br><br>MyComponent&gt;&gt;on: anAnnouncement&nbsp; send: aMessage to: anObject<br>
&nbsp;&nbsp;&nbsp; self announcer on: anAnnouncement&nbsp; send: aMessage to: anObject.<br><br>MyComponent&gt;&gt;initialize<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super initialize.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self on: SBAnnouncementClean send: #clean: to:self.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "and do other staff"<br>
<br>MyComponent&gt;&gt;clean<br>&nbsp;&nbsp;&nbsp;&nbsp; "here remove the decorations and do my staff"<br><br><br><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Diogenes Moreira</b> <span dir="ltr">&lt;<a href="mailto:diogenes.moreira@gmail.com">diogenes.moreira@gmail.com</a>&gt;</span><br>
Date: Tue, Mar 29, 2011 at 3:04 PM<br>Subject: Re: [Seaside] revel decoration<br>To: Seaside - general discussion &lt;<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a>&gt;<br><br><br>
well, in fact i'm remove the decoration, after rendering process.. is it posible?.<br>I wanna use a decorator only one time.<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Tue, Mar 29, 2011 at 2:29 PM, Johan Brichau <span dir="ltr">&lt;<a href="mailto:johan@inceptive.be" target="_blank">johan@inceptive.be</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br>
On 29 Mar 2011, at 19:17, Diogenes Moreira wrote:<br>
<br>
&gt; I don't know why, but &nbsp;the decorator is present at next rendering time for my component.<br>
<br>
</div>afaik, adding or removing a decorator is similar to changing the state of the component: you should not do that while rendering.<br>
The component state is saved before rendering, which means state changes during rendering are lost.<br>
<br>
A solution can be to add/remove the decorator in an action callback (e.g. from the calling site of #inform: ?)<br>
But I'm also interested why you are dynamically adding/removing a decorator like that.<br>
<br>
Johan_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</blockquote></div><br>
</div></div></div><br>
_______________________________________________<br>seaside mailing list<br><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br></blockquote></div><br></div></div></body></html>