[Seaside] jQuery html replace

Julian Fitzell jfitzell at gmail.com
Mon Jul 20 16:47:11 UTC 2009


It's not your fault at all. This stuff can get confusing (and if
nothing else it's different). The comments don't always do a good job
of making it clearer. I wonder if I could do a blog post on the scope
of renderers... I'll think about it.

Asking here is exactly the right thing to do and it helps us see where
the confusion is so we can prioritize our efforts to make things
better. If you see specific places methods or classes where better
comments would have helped you, please let us know.

Julian

On Mon, Jul 20, 2009 at 9:24 AM, Robert Sirois<watchlala at hotmail.com> wrote:
> Hmm... I'll have to think about that when I get back to this after work. I'm
> pretty much throwing myself into this and going with what works. I really
> need to sit down and read and understand what it is that's going on behind
> all these different methods and whatnot, but I am finding it hard to read
> through some of this code for some reason. The comments and stuff help
> sometimes... I guess I am just more of a hands-on learner :)
>
> Thanks for the help!
> RS
>
>> Date: Mon, 20 Jul 2009 09:14:20 -0700
>> Subject: Re: [Seaside] jQuery html replace
>> From: jfitzell at gmail.com
>> To: seaside at lists.squeakfoundation.org
>>
>> 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
>> >
>> >
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> ________________________________
> Bing™ brings you maps, menus, and reviews organized in one place. Try it
> now.
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>


More information about the seaside mailing list