I think you need to trigger the form, otherwise the callbacks are not called.<div><br></div><div>1) give your form an id</div><div>2) change the onChange event to:</div><div><br></div><div><div><font face="courier new, monospace">html prototype evaluator</font></div>
<div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>triggerForm: formId;</font></div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre">        </span>callback: [:script |</font></div>
<div><font face="courier new, monospace"> script prototype element<br> id: 'formB';<br> update: [ :renderer | self renderSecondListOn: renderer ]
</font></div><div><font face="courier new, monospace"> ]</font></div><div><br></div><br><div class="gmail_quote">On Mon, Jun 18, 2012 at 10:09 AM, Sabine Knöfel <span dir="ltr"><<a href="mailto:sabine.knoefel@gmail.com" target="_blank">sabine.knoefel@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br><br>Gerhard thank you for your answer!<br><br>I succeed in re-rendering ListB after selecting something new in ListA with >>renderSecondListOn:.<br>
So, this works now.<br><br>But the second problem still remains: after changing the code from "html scriptaculous updater" to the prototype version "html prototype evaluator", the callback (self numb: value) does not fire anymore.<br>
I need the callback for saving the selected enty in an instance variable "numb".<br><br>How can I save the selected list entry in the inst var?<br><br>Greetings <br>Sabine<br><br><br>renderListAOn: html<br> html<br>
form: [ <br> html select<br> id: 'listAID';<br> list: #('1' '2' '3' '4' '5' '6');<br> selected: numb;<br>
callback: [ :value | <br> 'fires' inspect.<br> self numb: value ];<br> onChange:<br> (html prototype evaluator<br>
callback: [ :script | <br> script prototype element<br> id: 'formB';<br> update: [ :renderer | self renderSecondListOn: renderer ] ];<br>
return: false) ]<br>##############<br>renderListBOn: html<br> html form<br> id: 'formB';<br> with: [ <br> html select<br> id: 'listBID';<br>
list: #('1' '2' '3' '4' '5' '6');<br> selected: numb ]<br>###############<br>renderSecondListOn: html<br> html select<br> id: 'listBID';<br>
list: #('1' '2' '3' '4' '5' '6' 're-rendered');<br> selected: numb<br> <br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
1. Re: How to use PTFactory>>evaluator for select list entry<br>
(beginners question) (Gerhard Obermann)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Fri, 15 Jun 2012 22:19:38 +0200<br>
From: Gerhard Obermann <<a href="mailto:obi068@gmail.com" target="_blank">obi068@gmail.com</a>><br>
Subject: Re: [Seaside] How to use PTFactory>>evaluator for select list<br>
entry (beginners question)<br>
To: Seaside - general discussion <<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a>><br>
Message-ID:<br>
<CAOB-OiDchty+cYo1oPxst9koHFxqTa2DGQOQv7T3U=<a href="mailto:Km6tRtPg@mail.gmail.com" target="_blank">Km6tRtPg@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hi Sabine and welcome!<br>
<br>
Try something like:<br>
<br>
script prototype element id: 'formB'; update: [:renderer | self<br>
renderSecondListOn: renderer ].<br>
<br>
renderSecondListOn: html<br>
html select<br>
id: 'listBID';<br>
list: #('1' '2' '3' '4' '5' '6');<br>
selected: numb<br>
<br>
Cheers<br>
Gerhard<br>
<br>
<br>
<br>
<br>
<br>
On Fri, Jun 15, 2012 at 12:45 PM, Sabine Knöfel <<a href="mailto:sabine.knoefel@gmail.com" target="_blank">sabine.knoefel@gmail.com</a>>wrote:<br>
<br>
> Hello,<br>
><br>
> I have 2 lists "ListA" and "ListB" and I want to follow "ListB" after<br>
> "ListA".<br>
> This means if I select a value in "listA", "listB" (which is in another<br>
> Form) should update automatically.<br>
><br>
> I have to use PTFactory>>evaluator, because I want to update more than one<br>
> DOM elememts later.<br>
><br>
> I succeed in *hiding* ListB after changing selection of ListA.<br>
> But do not know what to send instead of "hide" for updating ListB with<br>
> selection of ListA.<br>
><br>
> The value to select should be stored in an instance variable "numb". This<br>
> was working, when using "html scriptaculous updater" instead of "prototype<br>
> evaluator". After changing the code to use evaluator, the callback does not<br>
> work anymore.<br>
><br>
> Cheers<br>
> Sabine<br>
> ###########<br>
> renderListAOn: html<br>
> html<br>
> form: [<br>
> html select<br>
> id: 'listAID';<br>
> list: #('1' '2' '3' '4' '5' '6');<br>
> selected: numb;<br>
> callback: [ :value | self numb: value ];<br>
> onChange:<br>
> (html prototype evaluator<br>
> callback: [ :script |<br>
> script prototype element id:<br>
> 'listBID'. "hide"<br>
> numb inspect ];<br>
> return: false) ]<br>
> ###########<br>
> renderListBOn: html<br>
> html form<br>
> id: 'formB';<br>
> with: [<br>
> html select<br>
> id: 'listBID';<br>
> list: #('1' '2' '3' '4' '5' '6');<br>
> selected: numb ]<br>
><br>
> _______________________________________________<br>
<br>
</blockquote></div><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></blockquote></div><br></div>