Hi,<br>How does one save a sorted list back in the image ?<br>The details are as below.<br><br>ListView&gt;&gt; renderContentOn: html<br>html form: [<br>html render: self model title.<br>html div class: &#39;items&#39;;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; script: (html sortable tag: &#39;div&#39;;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; onUpdate: (html request<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; triggerSortable: &#39;items&#39;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; callback: [:col | self model items: col]));
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; with: [<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self model items do: [:eachItem| self renderItemOn:eachItem].<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; html submitButton callback: [self answer: self model]]]<br><br>ListView&gt;&gt; renderItemOn: anItem
<br>html<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; table: [html<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tableRow: [html tableData id: &#39;checkBoxItem&#39;;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; with: [html checkbox value: anItem done;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; callback: [:value | anItem done: value]].<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; html tableData id: &#39;myListEditItems&#39;;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; passenger: anItem;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; with: [
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; html render: anItem title]]]<br><br><br>The page is rendered and the items can be sorted. The sorting is only done on the client end. If I submit the button, the new order of the items isn&#39;t updated. Am I missing anything ?
<br><br>a) I tried to introduce a self halt in <br><br>html sortable tag: &#39;div&#39;;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; onUpdate: (html request<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; triggerSortable: &#39;items&#39;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; callback: [:col | <span style="color: rgb(255, 0, 0);">self halt.</span>self model items: col]));<br><br>It didn&#39;t halt for debugging.<br><br><br>b) I tried to introduce a temp variable which stores items, as follows,
<br><br>ListView&gt;&gt; renderContentOn: html<br>| tempList |<br><span style="color: rgb(255, 0, 0);">tempList := List new.</span><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">tempList items: self model items.
</span><br>
html form: [<br>
html render: self model title.<br>
html div class: &#39;items&#39;;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; script: (html sortable tag: &#39;div&#39;;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; onUpdate: (html request<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; triggerSortable: &#39;items&#39;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; callback: [:col | <span style="color: rgb(255, 0, 0);">tempList</span> items: col]));<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; with: [<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<span style="color: rgb(255, 0, 0);"> tempList</span> items do: [:eachItem| self renderItemOn:eachItem].<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; html submitButton callback: [<span style="color: rgb(255, 0, 0);">self model items: tempList items.</span>self answer: self model]]]<br><br><br>I knew this wouldn&#39;t work either as I had failed earlier to update items (which is an OrderCollection) by duplicating it and reassigning after changes. 
<br><br>By googling around, I found a solution that has been implemented in PHP.<br><br><a href="http://www.zenperfect.com/2007/07/26/sortable-lists-in-php-walkthrough/">http://www.zenperfect.com/2007/07/26/sortable-lists-in-php-walkthrough/
</a><br><br><br>I am not able to comprehend it properly.<br><br>In a nutshell, I have a list saved in my squeak image, I retrieve the list for sorting. After sorting it, it should be saved in the submitted order. <br><br>
Hoping to find some help,<br>Rajeev<br><br>PS: I am using Damien&#39;s 2.8 image<br><br><br><br clear="all"><br>-- <br>Rajeev Lochan<br><br>Co-founder, AR-CAD.com<br><br><a href="http://www.ar-cad.com">http://www.ar-cad.com
</a><br>+91 9243468076 (Bangalore)<br>080 65355873