[Seaside] Can't set id attribute

Bob Arning arning315 at comcast.net
Sat Apr 11 15:01:10 UTC 2015


That's because when you reach the end of the with: block for the span, 
it flushes the canvas which closes the currentBrush (the textInput) if 
needed.

IOW, by the time you try to set the id, all the html for the textInput 
has already been written. Try putting a
     self halt
before
     inputField id: id
and then explore html to see that this is the case

On 4/11/15 8:49 AM, Hilaire wrote:
> Dear all,
>
> In the following circumstance the id is not set as an attribute of the
> inputField (last line):
>
> renderWidgetId: id on: html
>      | tag inputField |
>      tag := (html span)
>          with: [
>              inputField := (html textInput)
>                  value: input;
>                  size: 10;
>                  callback: [ :val | self input: val ].
>              [...]
>          ];
>          yourself.
>      inputField id: id.
>
>
> Only when the id is set immediately, the id is correctly set:
>
> renderWidgetId: id on: html
>      | tag inputField |
>      tag := (html span)
>          with: [
>              inputField := (html textInput)
>                  value: input;
>                  size: 10;
>                  id: id;
>                  callback: [ :val | self input: val ].
>              [...]
>       ];
>        yourself.
>
>
> I need to set the id afterwards to factor out some code. There are
> probably other way I can do it, but I am really curious to know why the
> former code does not work.
>
> Thanks!
>
> Hilaire
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20150411/2999b210/attachment-0001.htm


More information about the seaside mailing list