Erm... not sure what you mean.
The rendering block needs to be invokable later, long after the page
has been rendered and the original canvas (in the method parameter
'html') has been cleaned up. In order to make this work, the rendering
block gets passed a new canvas each time it is invoked (via the block
parameter 'r'). So you need to make sure that you only use the new
renderer and not the old renderer from within that block (not that the
Slime package provides Lint tests that will catch this for you).
Also, remember that the #render: method expects a "renderable" object.
This could be a Component, a Block, or any number of other things. I
assume your #renderResultsOn: method was returning self and that was
causing the whole Component to be rendered again each time the block
was called.
Julian
On Mon, Jul 20, 2009 at 9:01 AM, Robert Sirois<watchlala at hotmail.com> wrote:
> Heh that worked perfectly :p So, 'html' is what is bein passed into that
> block?
>> RS
>>> Date: Mon, 20 Jul 2009 08:12:05 -0700
>> Subject: Re: [Seaside] jQuery html replace
>> From: jfitzell at gmail.com>> To: seaside at lists.squeakfoundation.org>>>> I may be misunderstanding your problem but shouldn't that be:
>>>> (html jQuery: '#display') html: [:r | self renderResultsOn: r]
>>>> ?
>>>> It looks pretty weird to me that you are trying to render the return
>> value of a rendering method...
>>>> Julian
>>>> On Sun, Jul 19, 2009 at 7:57 PM, Robert Sirois<watchlala at hotmail.com>
>> wrote:
>> > I wish there was an easy way to show this, but I'll try to describe it
>> > well...
>> >
>> > I'm using this statement...
>> >
>> > (html jQuery: '#display') html: [:r | r render: (self renderResultsOn:
>> > html)].
>> >
>> > ... in order to render the results of a survey. On the page I have a
>> > simple
>> > select menu and a button that let's you pick between the available
>> > surveys.
>> > What is happening is the page is being loaded fine, I can select the
>> > survey
>> > fine, hit the button, the results display fine, but then the original
>> > div
>> > with the dropdown and button is also added to the bottom of the #display
>> > div
>> > (see above). The display div is simply:
>> >
>> > html div
>> > id: 'display'.
>> >
>> > I've tried taking the div out of the #with: statement where the select
>> > box
>> > and button are also in, but that does not seem to help. There are a
>> > couple
>> > other places I have been using the jQuery replace code, and it appears
>> > to be
>> > working correctly in those instances.
>> >
>> > Thanks,
>> > RS
>> >
>> > ________________________________
>> > Windows Live™ SkyDrive™: Store, access, and share your photos. See how.
>> > _______________________________________________
>> > seaside mailing list
>> > seaside at lists.squeakfoundation.org>> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside>> >
>> >
>> _______________________________________________
>> seaside mailing list
>>seaside at lists.squeakfoundation.org>>http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside>> ________________________________
> Windows Live™ Hotmail®: Search, add, and share the web’s latest sports
> videos. Check it out.
> _______________________________________________
> seaside mailing list
>seaside at lists.squeakfoundation.org>http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside>>