Struts2 & jquery - custom pagination - how to go to page2 without hitting the db again -
thanks in advance input. using struts2 , jquery in app.
i tried use displaytag pagination tables have images , there wasn't way make displaytag work images.
so have custom coded pagination uses <s:subset>
works great far except don't know how make go page.
basically in <s:subset>
want change start attribute , refresh jsp. code evaluates start attribute correctly given page number.
my s:subset tag below,
<s:subset source="pageablelist.pagedlist" count="pageablelist.pagesize" start="pageablelist.start" > <s:iterator>
i think want use <s:url>
display clickable page numbers i'm having trouble there.
i have page numbers in list (which evaluate in action class right after search completes), in jsp need display clickable page numbers, iterate through list, displaying page numbers below -
<s:iterator value="pagenumlist" > | <a href='#'> <s:property/> </a> </s:iterator>
i guess need pass clicked value of page number action class, since search results in list in action class, without hitting database again display results page new value of start attribute.
any ideas how might that? have been considering using decider attribute <s:subset>
maybe there simpler way?
thanks again input.
regards, veecan
if not want hit db again, cache results of initial query in ram in action class (reference static cache somewhere). also, don't have go cache-all-or-nothing approach -- can cache first n pages , when near end of cache, fetch rest. if right, can maintain minimum ram footprint preserve snappy user experience leverages user think time (depends on app).
Comments
Post a Comment