Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
None
-
None
-
web dev environment: wicket1.4.7 jdk1.6 tomcat6.0
system environment: Windows xp
Description
Thanks Igor Vaynberg and every sharer!
I checked a variety url coding strategies, but did not find one that is very appropriate when using datatable and navigator in page.
HybridUrlCodingStrategy might also be, but it can not display the page parameter in url, can not be true bookmarkable.
And the version number int its url will make the user confused.
So I look forward to using MixedParamUrlCodingStrategy, which may need to find out navigation links parameter name in the navigator,such as:first,next,etc!
Maybe we should not do the same thing to reinvent the wheel.
After a morning of thinking and programming, I wrote a few simple restful navigator implement!
Here are main 4 classes:
1.BookmarkablePagingNavigator
2.BookmarkablePagingNavigation
3.BookmarkablePagingNavigationLink
4.BookmarkablePagingNavigationIncrementLink
Core idea is to override PagingNavigator and PagingNavigation classes' newPagingNavigationLink and newPagingNavigationIncrementLink methods.
BookmarkablePagingNavigationLink extends from PagingNavigationLink.
BookmarkablePagingNavigationLink's work depends on CharSequence getURL() method:
protected CharSequence getURL () (
if (getPopupSettings ()! = null)
throw new IllegalStateException ("You cannot specify popup settings and a page map");
PageParameters parameters = getPageParameters ();
if (getPopupSettings ()! = null)
return urlFor (getPopupSettings (). getPageMap (this),
getPageClass (), parameters);
else
return urlFor (getPageClass (), parameters);
)
I'm so glad to give my gift:I put these classes as attachment with this mail,please share it~
TO FIX: it can not handle the search bar of the parameters or other parameters of DataTable Headers(such as sort param).
Here is our discuss track:
http://apache-wicket.1842946.n4.nabble.com/Which-url-coding-strategy-to-make-more-restful-in-page-with-navigator-tp2197248p2197248.html