<div dir="ltr"><div class="gmail_quote"><div>Thanks James for the response and welcome! :)<br><br>I went back to the #callback: style and used #setFocus in both methods for testing. With "...html textInput setFocus;...." present in both methods I know longer get a stack trace, but the focus ends up on the last receiver. So definitely has something to do with #setFocus not being present. I then re-wrote the methods using #on:of: style (see below), with #setFocus present in both, one or neither of the methods. It worked in all 3 scenarios and there are no cascades present.<br>
<br><span style="font-family: courier new,monospace;">renderCompanyTextInputOn: html</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> self </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> renderLabel: 'Company Name: '</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> input: [</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> html textInput on: #companyName of: self headDataModelView]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> output: self headDataModelView companyName</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> on: html.</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">renderEmployeeTextInputOn: html</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> self </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> renderLabel: 'Employee Name: '</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> input: [</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> html textInput setFocus on: #employeeName of: self headDataModelView]</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> output: self headDataModelView employeeName</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> on: html.<br>
<br><span style="font-family: arial,helvetica,sans-serif;">The Seaside examples, which I used as references, can be found in Seaside-Tests-Functional WAInputElementContainer>>renderTextInputOn:, WAInputElementContainer>>renderTextInputExampleOn: etc. but these work.<br>
<br>Anyway, I will move forward using the #on:of: as these work and appear to achieve the same as the #callback: method.<br><br>Thanks for the help.<br><br>Regards<br>Adrian<br></span></span> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Message: 7<br>
Date: Sat, 30 Aug 2008 22:05:41 +0200<br>
From: James Foster <Smalltalk@JGFoster.net><br>
Subject: Re: [Seaside] Newbie question<br>
To: Seaside - general discussion <<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a>><br>
Message-ID: <B7D0654B-53B8-4A3C-B213-7691536A8825@JGFoster.net><br>
Content-Type: text/plain; charset="us-ascii"<br>
<br>
Hi Adrian,<br>
<br>
I haven't tried your code myself, but a brief visual scan suggests at<br>
least one problem that I've identified below...<br>
<br>
On Aug 30, 2008, at 9:32 PM, r00t uk wrote:<br>
<br>
> Hello All<br>
><br>
> I am slowly working my way through Squeak and Seaside using "An<br>
> Introduction to Seaside" and the Seaside examples as my learning<br>
> guides. I have come across an issue which I don't understand, and I<br>
> am hoping someone could enlighten me as to what is going wrong. The<br>
> two methods below are called by<br>
> MLHeadDataModelView>>renderContentOn:, with<br>
> MLHeadDataModelView>>renderCompanyTextInputOn: resulting in a<br>
> MessageNotUnderstood: WARenderCanvas>>value: error.<br>
><br>
> The instance methods are:<br>
><br>
> MLHeadDataModelView>>renderCompanyTextInputOn: "This method<br>
> generates the 'MessageNotUnderstood: WARenderCanvas>>value:' error"<br>
> self<br>
> renderLabel: 'Company Name: '<br>
> input: [<br>
> html textInput;<br>
> value: self headDataModelView companyName;<br>
> callback: [:value | self headDataModelView companyName:<br>
> value]]<br>
> output: self headDataModelView companyName<br>
> on: html.<br>
><br>
> MLHeadDataModelView>>renderEmployeeTextInputOn:<br>
> self<br>
> renderLabel: 'Employee Name: '<br>
> input: [<br>
> html textInput setFocus;<br>
<br>
In Smalltalk the semantics of a cascade (indicated by the semi-colon)<br>
means that the following #value: message is being sent to the receiver<br>
of the last message. The last message is #setFocus, and the receiver<br>
of the #setFocus was the object returned by the #textInput message.<br>
Thus, #value: is being sent to a WATextInputTag (or similar object),<br>
not to the WARenderCanvas (which is probably what you really wanted).<br>
<br>
> value: self headDataModelView employeeName;<br>
> callback: [:value | self headDataModelView employeeName:<br>
> value]]<br>
> output: self headDataModelView employeeName<br>
> on: html.<br>
><br>
> MLHeadDataModelView>>initialize<br>
> initialize<br>
> super initialize.<br>
> self headDataModelView: MLHeadDataModel new.<br>
><br>
> I don't get any error messages if I use the on:of: style, but not<br>
> sure what exact difference or benefits are between the two.<br>
<br>
The difference is that you don't have a #setFocus message.<br>
<br>
> MLHeadDataModelView>>renderCompanyTextInputOn:<br>
> renderCompanyTextInputOn: html<br>
> self<br>
> renderLabel: 'Company Name: '<br>
> input: [<br>
> html textInput on: #companyName of: self<br>
> headDataModelView]<br>
> output: self headDataModelView companyName<br>
> on: html.<br>
><br>
> MLHeadDataModelView>>renderEmployeeTextInputOn:<br>
> renderEmployeeTextInputOn: html<br>
> self<br>
> renderLabel: 'Employee Name: '<br>
> input: [<br>
> html textInput on: #employeeName of: self<br>
> headDataModelView]<br>
> output: self headDataModelView employeeName<br>
> on: html.<br>
><br>
> Thanks in advance for any feedback.<br>
><br>
> Regards<br>
> Adrian<br>
<br>
Hope that helps, and welcome to Seaside!<br>
<br>
James Foster<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://lists.squeakfoundation.org/pipermail/seaside/attachments/20080830/febc0a74/attachment.htm" target="_blank">http://lists.squeakfoundation.org/pipermail/seaside/attachments/20080830/febc0a74/attachment.htm</a><br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br>
<br>
End of seaside Digest, Vol 68, Issue 38<br>
***************************************<br>
</blockquote></div><br></div>