Although I'm not a committer, I'd like to open RFE for an API change, and
I'd like to get feedback from the devs.

Here's my complaint.  When I'm using an AjaxFallbackLink, I'm making an
explicit decision that I want to handle ajax and "non-ajax" requests in
different ways.  The problem is that there's only one callback function
which causes my implementation to *always* look something like this:

new AjaxFallbackLink() {
 protected void onClick(AjaxTarget target) {
   if (target == null) {
     //ajax not used, fallback to normal
     getRequestCycle().setResponsePage(Foo.class);
   }
   //perform ajax stuff
   target.addComponent(this);
 }

I think it would be much nicer if the API had two extension points to avoid
this branching logic.  something like:

new AjaxFallbackLink() {
 protected void onFallbackClick() {
     //ajax not used, fallback to normal
     getRequestCycle().setResponsePage(Foo.class);
 }

 protected void onClick(AjaxTarget target) {
   //perform ajax stuff
   target.addComponent(this);
 }

I'd be happy to open an issue and even provide patches if others think this
would be useful.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to