[Seaside] body attributes?

Andreas Nilsson wahboh at mac.com
Sun Sep 19 14:27:16 CEST 2004


Thanks, I totally missed the possibility of setting onLoad from within 
the script (Javascript is clearly not my thing), I'll try that instead.
Kind of suspected that the reason for the 'I call you' layout of 
updateRoot: was meant to allow for it to be called whenever Seaside 
feels like it.

/Adde

On 2004-09-19, at 10.48, Avi Bryant wrote:

>
> On Sep 19, 2004, at 10:36 AM, Andreas Nilsson wrote:
>
>> Is there any way to alter the body attributes while rendering, ie. 
>> inside renderContentOn?
>
> No, the way it's currently structured is meant to allow the HTML 
> document to be streamed out the socket, given webserver support - so 
> by the time you get to rendering the content, the body attributes have 
> already been sent.
>
>> Otherwise Avi's proposed solution to getting the name of the 
>> file-input:
>>
>> |name|
>> name := html context nextKey.
>> html fileInputWith...
>>
>> doesn't help much anymore as that's the name that I need to reference 
>> from the Javascript that I'm putting in body.onLoad.
>
> Well, probably the simplest solution is just to use a css id instead.  
> But you could also add an onLoad handler from a script within the 
> body, couldn't you?  Something like:
>
> <script>
> document.body.onLoad = function(){....}
> </script>
>
> Actually onLoad is generally useful enough that there should probably 
> be a standard piece of JS used in Seaside for registering multiple 
> onLoad actions, so that you could just do
>
> html addOnLoadHandler: 'document.getElementById("foo").focus()'
>
> or whatever.  Anyone have something like this kicking around?
>
>> I need to be able to get the name first and then set the body 
>> attribute and I don't have any control of when #updateRoot: is called 
>> so I can't guarantee that I've got the file-input name.
>
> I can guarantee that you don't - because of the streaming structure, 
> #updateRoot: will always be called before #renderContentOn: is (and 
> #updateUrl: will always be called before that).
>
> Avi
>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside



More information about the Seaside mailing list