[Seaside] Twitter Bootstrap Pagination issue
Lawrence Kellogg
mac.hive at me.com
Wed Mar 21 15:37:28 UTC 2012
On Mar 21, 2012, at 9:59 AM, Paul DeBruicker wrote:
> Why not just subclass WABatchedList and render its pagination controls as list items?
>
>
Paul,
Thanks for this recommendation, I see that I have reinvented WABatchedList, ha ha. I didn't know the class existed. Mine does some other stuff, but I will see about subclassing WABatchList to do what I need to do.
Larry
>
>
>
> 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&_k=
>>> 1rwinvTch1gVzvnC&38">Previous</a></li><li class="active"><a
>>> href="/PracticeJournalLoginTask?_s=iwwzfPJxijSN6asi&_k=
>>> 1rwinvTch1gVzvnC&39">1</a></li><li class="inactive"><a
>>> href="/PracticeJournalLoginTask?_s=iwwzfPJxijSN6asi&_k=
>>> 1rwinvTch1gVzvnC&40">2</a></li><li class="inactive"><a
>>> href="/PracticeJournalLoginTask?_s=iwwzfPJxijSN6asi&_k=
>>> 1rwinvTch1gVzvnC&41">3</a></li><li class="inactive"><a
>>> href="/PracticeJournalLoginTask?_s=iwwzfPJxijSN6asi&_k=
>>> 1rwinvTch1gVzvnC&42">4</a></li><li class="inactive"><a
>>> href="/PracticeJournalLoginTask?_s=iwwzfPJxijSN6asi&_k=
>>> 1rwinvTch1gVzvnC&43">5</a></li><li class="inactive"><a
>>> href="/PracticeJournalLoginTask?_s=iwwzfPJxijSN6asi&_k=
>>> 1rwinvTch1gVzvnC&44">6</a></li><li class="inactive"><a
>>> href="/PracticeJournalLoginTask?_s=iwwzfPJxijSN6asi&_k=
>>> 1rwinvTch1gVzvnC&45">7</a></li><li class="inactive"><a
>>> href="/PracticeJournalLoginTask?_s=iwwzfPJxijSN6asi&_k=
>>> 1rwinvTch1gVzvnC&46">8</a></li><li class="inactive"><a
>>> href="/PracticeJournalLoginTask?_s=iwwzfPJxijSN6asi&_k=
>>> 1rwinvTch1gVzvnC&47">9</a></li><li class="inactive"><a
>>> href="/PracticeJournalLoginTask?_s=iwwzfPJxijSN6asi&_k=
>>> 1rwinvTch1gVzvnC&48">10</a></li><li class="next"><a href="/
>>> PracticeJournalLoginTask?_s=iwwzfPJxijSN6asi&_k=
>>> 1rwinvTch1gVzvnC&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
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
More information about the seaside
mailing list