<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="Georgia">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. <br>
<br>
IOW, by the time you try to set the id, all the html for the
textInput has already been written. Try putting a <br>
self halt</font> <br>
before <br>
inputField id: id<br>
and then explore html to see that this is the case<br>
<br>
<div class="moz-cite-prefix">On 4/11/15 8:49 AM, Hilaire wrote:<br>
</div>
<blockquote cite="mid:mgb58p$9gg$1@ger.gmane.org" type="cite">
<pre wrap="">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
</pre>
</blockquote>
<br>
</body>
</html>