imho that is the best practice. that is what i use whenever i do not need a bookmarkable page. i have yet to use the PageLink class. PageLink makes it easier to create links to pages because it lets you specify the class name of the page or the created page instance. This is ok for pages that are not bookmarkable and take no parameters, but most of the time that is not the case in my experience.

if you work with bookmarkable pages a lot, a static factory method that fills in pageparameters can help with type safety and forgotten params.

-Igor


On 11/18/05, Gustavo Hexsel <[EMAIL PROTECTED]> wrote:
  Hi all,

  I wanted to know what's the best way to use Links (PageLinks, BookmarkablePageLinks).

  In the beginning, I was using BookmarkablePageLink's and converting everything to and from Strings.  That obviously was flawed, as I was using string names and passing them back and forth (lost strong-typing, occasionally forgot one parameter, or mistyped the name of it).  It also made me reload objects from the database even though I had them handy on the calling class.

  Then I tried using PageLink's, passing a "new XXXPage(whateverparameter)" in the constructor.  That didn't work either, as pages have links back and forth, leading to stackoverflows.

  Then I moved one step up in the object hierarchy and started using Link's, but it seems such red tape for each link having to write:
add(new Link("cancelLink") {
        public void onClick() { setResponsePage(new EditProviderPage(provider)); };
});

  Any suggestions?


   []s Gus






-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_idv28&alloc_id845&opclick
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to