[Seaside] Twitter Bootstrap Pagination issue

Paul DeBruicker pdebruic at gmail.com
Wed Mar 21 13:59:48 UTC 2012


Why not just subclass WABatchedList and render its pagination controls 
as list items?





On 12-03-21 06:35 AM, Lawrence Kellogg wrote:
>
> On Mar 21, 2012, at 9:11 AM, Nick Ager wrote:
>
>> Hi,
>>
>> It might be that you are seeing this issue:
>> http://code.google.com/p/glassdb/issues/detail?id=221
>> discussion:
>> http://forum.world.st/use-of-method-temporaries-in-callback-blocks-td2340788.htm
>>
>> You can work around it by using a WAValueHolder
>>
>
> Thanks, Nick, I knew it was some sort of a problem related to
> temporaries in blocks.
> Unfortunately, this:
>
> html listItem
> class: (self pageNumberActiveForPage: (WAValueHolder with: pageNumber));
> with: [ html anchor
> callback: [ self goToPage: (WAValueHolder with: pageNumber) ];
> with: pageNumber ]].
>
> does not fix the problem. I am calling contents in the receiving
> methods, of course.
>
> Am I doing something wrong in terms of using a WAValueHolder to fix the
> problem?
>
> Larry
>
>> Hope this helps
>>
>> Nick
>>
>> On 21 March 2012 12:03, Lawrence Kellogg <mac.hive at me.com
>> <mailto:mac.hive at me.com>> wrote:
>>
>>     Hello,
>>     So, while we're on the subject of Twitter Bootstrap, I have run
>>     into a strange issue while moving my code into GLASS. I am using the
>>     Pagination control from Twitter Bootstrap.
>>
>>     I have this code to generate the pagination control
>>
>>     html div
>>     class: 'pagination';
>>     with: [
>>     html unorderedList: [
>>     ...
>>     startPageNumber to: endPageNumber do: [ :pageNumber |
>>     html listItem
>>     class: (self pageNumberActiveForPage: pageNumber);
>>     with: [ html anchor
>>     callback: [ self goToPage: pageNumber ];
>>     with: pageNumber ]
>>     …]]
>>     which generates this:
>>
>>     <div class="pagination"><ul><li class="prev disable"><a href="/​
>>     PracticeJournalLoginTask?_s=​iwwzfPJxijSN6asi&amp;_k=​
>>     1rwinvTch1gVzvnC&amp;38">​Previous</a></li><li class="active"><a
>>     href="/​PracticeJournalLoginTask?_s=​iwwzfPJxijSN6asi&amp;_k=​
>>     1rwinvTch1gVzvnC&amp;39">1</a>​</li><li class="inactive"><a
>>     href="/​PracticeJournalLoginTask?_s=​iwwzfPJxijSN6asi&amp;_k=​
>>     1rwinvTch1gVzvnC&amp;40">2</a>​</li><li class="inactive"><a
>>     href="/​PracticeJournalLoginTask?_s=​iwwzfPJxijSN6asi&amp;_k=​
>>     1rwinvTch1gVzvnC&amp;41">3</a>​</li><li class="inactive"><a
>>     href="/​PracticeJournalLoginTask?_s=​iwwzfPJxijSN6asi&amp;_k=​
>>     1rwinvTch1gVzvnC&amp;42">4</a>​</li><li class="inactive"><a
>>     href="/​PracticeJournalLoginTask?_s=​iwwzfPJxijSN6asi&amp;_k=​
>>     1rwinvTch1gVzvnC&amp;43">5</a>​</li><li class="inactive"><a
>>     href="/​PracticeJournalLoginTask?_s=​iwwzfPJxijSN6asi&amp;_k=​
>>     1rwinvTch1gVzvnC&amp;44">6</a>​</li><li class="inactive"><a
>>     href="/​PracticeJournalLoginTask?_s=​iwwzfPJxijSN6asi&amp;_k=​
>>     1rwinvTch1gVzvnC&amp;45">7</a>​</li><li class="inactive"><a
>>     href="/​PracticeJournalLoginTask?_s=​iwwzfPJxijSN6asi&amp;_k=​
>>     1rwinvTch1gVzvnC&amp;46">8</a>​</li><li class="inactive"><a
>>     href="/​PracticeJournalLoginTask?_s=​iwwzfPJxijSN6asi&amp;_k=​
>>     1rwinvTch1gVzvnC&amp;47">9</a>​</li><li class="inactive"><a
>>     href="/​PracticeJournalLoginTask?_s=​iwwzfPJxijSN6asi&amp;_k=​
>>     1rwinvTch1gVzvnC&amp;48">10</​a></li><li class="next"><a href="/​
>>     PracticeJournalLoginTask?_s=​iwwzfPJxijSN6asi&amp;_k=​
>>     1rwinvTch1gVzvnC&amp;49">Next<​/a></li></ul></div>
>>
>>     but when that goToPage: method is called, the pageNumber value is
>>     always the last one in the list, 10 in this case, even
>>     when I clicked on page 2. This code works fine on my local
>>     Seaside/Pharo image so I am kind of puzzled as to what is going
>>     on. Any thoughts?
>>
>>     Larry
>>
>>     _______________________________________________
>>     seaside mailing list
>>     seaside at lists.squeakfoundation.org
>>     <mailto:seaside at lists.squeakfoundation.org>
>>     http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>>
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> <mailto:seaside at lists.squeakfoundation.org>
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



More information about the seaside mailing list