<div>Well, if you want to re-render the page, you can just send beSubmitOnChange to the select tag.</div>
<div> </div>
<div> </div>
<div class="gmail_quote">On Thu, Oct 13, 2011 at 11:44 AM, squeakman <span dir="ltr"><<a href="mailto:squeakman@gmail.com">squeakman@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Thanks Bob and John,<br><br>I have done as you suggested and it does work.<br><br>Here is what the my code now looks like:<br>
<br>(html select)<br> id: 'stocksList';<br> list: self listOfStocks;<br><br> " Ajax Callback 1 "<br> onChange: (html scriptaculous request<br> triggerForm: (html scriptaculous element up: 'form'));<br>
<br> "Ajax Callback 2"<br> onChange: (html scriptaculous evaluator callback: [:s | s refresh]);<br><br> "non Ajax Callback "<br> callback: [:selStock | self selectedStock: selStock]<br><br><br>If I understand things correctly, on change causes "Ajax Callback 1" to be called which causes "non Ajax Callback" to be called where the selected stock is updated.<br>
<br>This works but I also want to re-render the page without having to use a Submit button. I thought that the "non Ajax Callback" would have caused the entire page to be re-rendered but that does not happen.<br>
<br>The "Ajax Callback 2" forces the re-rendering of the page.<br><br>One last question to wrap this up: "Is this the prescribed way to do this task?".<br><br>Thank you very much,<br>Frank<br><br><br><br>
<br><br>On 13/10/2011 10:40 AM, John McKeon wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">I would add that to get the callback to occur via AJAX add:<br>onChange: (html jQuery ajax serializeThisWithHidden)<br>
And in an attempt to make it clearer:<br>The parameter in the list: message is a collection of *objects* and the<br>callback :value will be the selected object. If you give it a collection<br>of string representations of your Stock objects, you will get back the<br>
selected string representation. But if you give it a collection of<br>Stocks in this case, you will get back the selected Stock object.<br>Seaside handles the bookwork for you in determining which object in the<br>collection was selected. You don't need to deal with the selected index<br>
if you don't want to.<br><br>On Thu, Oct 13, 2011 at 10:16 AM, Bob Arning <<a href="mailto:arning@charm.net" target="_blank">arning@charm.net</a><br><mailto:<a href="mailto:arning@charm.net" target="_blank">arning@charm.net</a>>> wrote:<br>
<br> We had a very similar question on 28-29 Sept (see "Using the select<br> tag"). The end result was something like:<br><br> (html select)<br> list: self genders;<br> selected: self contact gender;<br>
enabled: [:ea | ea notNil];<br> labels: [:ea | ea ifNil: ['---'] ifNotNil: [ea printableVersion]];<br> callback: [:value | self contact gender: value].<br><br> Cheers,<br> Bob<br><br><br>
</blockquote><br>______________________________<u></u>_________________<br>seaside mailing list<br><a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.<u></u>squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.<u></u>org/cgi-bin/mailman/listinfo/<u></u>seaside</a><br>
</blockquote></div><br>