On 5/20/07, Richard Jones <[EMAIL PROTECTED]> wrote:
I'm wanting to have different pagers displayed on the same page
template.  For example displaying the WeblogEntriesPager,
CommentsPager and UsersPager all on the frontpage weblog.  There's no
problem initially displaying them, but when it comes to paging through
then each pager reacts to the same next/prev links (when ?page=1, all
pagers move to the next set of results).

We made the assumption that there will only be one pager per page, so
that's going to be a problem. Instead, you could use Ajax widgets
instead to add multiple pagable elements to a page. For example,
here's a pagable Dojo table widget that uses a pager that is not part
of the main page: http://rollerweblogger.org/roller/page/dojoroller

The pager exists in a separate page that generates JSON data for the
table, here's the page template that generates the JSON data for the
table:

#if($model.getRequestParameter("columns") == "true")
   [{field:"pubTime"}, {field:"title"}]
#else
  #set($pager = $model.getWeblogEntriesPager())
  #set($map = $pager.getEntries()) {
  #if($pager.nextLink) nextLink:"$pager.nextLink", #end
  #if($pager.prevLink) prevLink:"$pager.prevLink", #end
  data: [
  #foreach($day in $map.keySet())
     #set($entries = $map.get($day))
     #foreach($entry in $entries)
        #if($comma),#else#set($comma = true)#end
        {id: "$entry.website.handle:$entry.anchor",
         pubTime: "$entry.pubTime", title:"$entry.title" }
     #end
  #end ] }
#end

And here's what the generated JSON data looks like:
http://rollerweblogger.org/roller/page/dojoentries

Does that make sense?

- Dave

Reply via email to