Now I need to find a solution for session timeouts. If a session times out and the user clicks on a checkbox nothing happens (obviously).<br>How can I redirect that request to act as an initial request for the root component (so to say)?<br>
<br>Thanks,<br> Alex<br><br><div class="gmail_quote">2011/9/26 Alexander Lazarević <span dir="ltr"><<a href="mailto:laza@blobworks.com">laza@blobworks.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Sweet! That works like a charm. Thanks<br>
<br>
Alex<br>
<br>
2011/9/26 Lukas Renggli <<a href="mailto:renggli@gmail.com">renggli@gmail.com</a>>:<br>
<div><div></div><div class="h5">> On 26 September <a href="tel:2011%2013" value="+49201113">2011 13</a>:39, Lukas Renggli <<a href="mailto:renggli@gmail.com">renggli@gmail.com</a>> wrote:<br>
>> It is probably the easiest if you just re-render that part of the<br>
>> page. I suggest a refactorings along the following lines:<br>
>><br>
>>> renderContentOn: html<br>
>><br>
>> | id |<br>
>> id := html nextId.<br>
>> html div id: id; with: [<br>
>><br>
>>> html form: [<br>
>>> html checkbox<br>
>>> onChange: (html jQuery ajax serializeThisWithHidden);<br>
>><br>
>> You do replace the above line with:<br>
>><br>
>> onChange: ((html jQuery id: id) load serializeThisWithHidden;<br>
>> html: [ :r | self renderContentOn: r ])<br>
><br>
> Sorry, this is a bit buggy. You don't want to re-render the div here,<br>
> just what is inside. So better extract the inner part to a separate<br>
> method.<br>
><br>
>><br>
>>> value: self isChecked;<br>
>>> callback: [:value | self check: value. self check2: value].<br>
>>> html text: 'Check me'.<br>
>>> html checkbox<br>
>>> onChange: (html jQuery ajax serializeThisWithHidden);<br>
>><br>
>> And do the same here. Maybe extract it to a separate method so that<br>
>> you can reuse it.<br>
>><br>
>>> value: self isChecked2;<br>
>>> callback: [:value | self check2: value. self check: value not].<br>
>>> html text: 'Check me 2'.<br>
>>> ]<br>
>>><br>
>>> So what's the best strategy to update the checkboxes reflecting the<br>
>>> internal state?<br>
>><br>
>> ] "close the div here"<br>
>><br>
>> Cheers,<br>
>> Lukas<br>
>><br>
>>><br>
>>> Alex<br>
>>><br>
>>> 2011/9/26 Alexander Lazarević <<a href="mailto:laza@blobworks.com">laza@blobworks.com</a>>:<br>
>>>> Robert and Lukas,<br>
>>>><br>
>>>> I guess I still have some misconceptions when it comes to JS<br>
>>>> callbacks, but thanks for helping me along. I had the idea that the<br>
>>>> entire form gets serialized, but only the callbacks of changed<br>
>>>> elements would trigger a onChange: event and then trigger the<br>
>>>> callback.<br>
>>>><br>
>>>> Alex<br>
>>>><br>
>>>> 2011/9/24 Lukas Renggli <<a href="mailto:renggli@gmail.com">renggli@gmail.com</a>>:<br>
>>>>> Yes, you serialize the form which means it involves both checkboxes. On your<br>
>>>>> scenario both callbacks should be triggered: the checked one with true, the<br>
>>>>> unchecked with false.<br>
>>>>><br>
>>>>> Btw, you do not need the IDs. For the AJAX just use (html jQuery ajax<br>
>>>>> serializeForm). You don't want to load anything into the checkbox.<br>
>>>>><br>
>>>>> Lukas<br>
>>>>><br>
>>>>> On Saturday, 24 September 2011, Alexander Lazarević <<a href="mailto:laza@blobworks.com">laza@blobworks.com</a>><br>
>>>>> wrote:<br>
>>>>>> Hi!<br>
>>>>>><br>
>>>>>> I'm using something like the following in my code:<br>
>>>>>><br>
>>>>>> renderContentOn: html<br>
>>>>>> | id |<br>
>>>>>> html form: [<br>
>>>>>> id := html nextId.<br>
>>>>>> html checkbox<br>
>>>>>> id: id;<br>
>>>>>> onChange: (html jQuery id: id) load serializeForm;<br>
>>>>>> value: self isChecked;<br>
>>>>>> callback: [:value | value inspect].<br>
>>>>>> html text: 'Check me'.<br>
>>>>>> id := html nextId.<br>
>>>>>> html checkbox<br>
>>>>>> id: id;<br>
>>>>>> onChange: (html jQuery id: id) load serializeForm;<br>
>>>>>> value: self isChecked2;<br>
>>>>>> callback: [:value | value inspect].<br>
>>>>>> html text: 'Check me 2'.<br>
>>>>>> ]<br>
>>>>>><br>
>>>>>> I'm surprised to see that both callbacks get triggered even if I only<br>
>>>>>> check one checkbox. Is this on purpose and expected? According to<br>
>>>>>> Metacello I'm using Seaside 3.0.6<br>
>>>>>><br>
>>>>>> Alex<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>
>>>>> --<br>
>>>>> Lukas Renggli<br>
>>>>> <a href="http://www.lukas-renggli.ch" target="_blank">www.lukas-renggli.ch</a><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>
>>>><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>
>><br>
>><br>
>> --<br>
>> Lukas Renggli<br>
>> <a href="http://www.lukas-renggli.ch" target="_blank">www.lukas-renggli.ch</a><br>
>><br>
><br>
><br>
><br>
> --<br>
> Lukas Renggli<br>
> <a href="http://www.lukas-renggli.ch" target="_blank">www.lukas-renggli.ch</a><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>
</div></div></blockquote></div><br>