thats funny, i came to the opposite conclusion when designing it. most of my
usecases looked like this

onclick(AjaxRequestTarget) {
  // dosomething
  if (target!=null) {
       // setup repaint
  }
}

the // dosomething being the same between ajax and non ajax versions, so
having two methods was being pita.

if you come up against your usecase a lot why not create a simple subclass
and route to different methods?

-igor


On 1/8/07, Ryan Sonnek <[EMAIL PROTECTED]> wrote:

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



-------------------------------------------------------------------------
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