Wicket
  1. Wicket
  2. WICKET-2747

AjaxPagingNavigator Link factories should return AbstractLink

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.5
    • Fix Version/s: 6.0.0-beta1
    • Component/s: wicket
    • Environment:
      CentOS 5.0, Sun Glassfish v2.1, Wicket 1.4.x.

      Description

      AjaxPagingNavigator doesn't submit forms. The mailinglists instruct the user to override the Link factory classes in order to return SubmitLinks. However, both SubmitLink and AjaxSubmitLink do not inherit from Link. It is my opinion that AjaxPagingNavigator.new*Link() functions should return AbstractLink.

      I am currently forced to fork the majority of AjaxPagingNavigator inorder to create a "Sub"class.

        Activity

        Hide
        Paul Giblock added a comment -

        Actually, things are more complex. It cannot be based on AbstractLink without some hefty refactoring. The PagingNavigation*Link classes need to be able to trap when the link is clicked - AbstractLink does not provide this hook. And, unfortunately, SubmitLink has a onSubmit method while Link<T> has a onClick link. What would have to happen is some sort of interface like IClickable be shared between the two classes - or maybe SubmitLink can inherit Link<>?

        Otherwise, the only real alternative is to make an entirely separate hierarchy of: PagingNavigationSubmitLink, PagingNavigationIncrementSubmitLink, SubmittingPagingNavigator, AjaxSubmittingPagingNavigation, AjaxSubmittingPagingNavigationBehavior, AjaxPagingNavigationSubmitLink, AjaxPagingNavigationIncrementSubmitLink, and finally, AjaxSubmittingPagingNavigator

        Quite a few classes to reproduce just to have a navigator within a form.. I still don't have a working version, and I'm leaving the office. I'll report back tomorrow.

        Show
        Paul Giblock added a comment - Actually, things are more complex. It cannot be based on AbstractLink without some hefty refactoring. The PagingNavigation*Link classes need to be able to trap when the link is clicked - AbstractLink does not provide this hook. And, unfortunately, SubmitLink has a onSubmit method while Link<T> has a onClick link. What would have to happen is some sort of interface like IClickable be shared between the two classes - or maybe SubmitLink can inherit Link<>? Otherwise, the only real alternative is to make an entirely separate hierarchy of: PagingNavigationSubmitLink, PagingNavigationIncrementSubmitLink, SubmittingPagingNavigator, AjaxSubmittingPagingNavigation, AjaxSubmittingPagingNavigationBehavior, AjaxPagingNavigationSubmitLink, AjaxPagingNavigationIncrementSubmitLink, and finally, AjaxSubmittingPagingNavigator Quite a few classes to reproduce just to have a navigator within a form.. I still don't have a working version, and I'm leaving the office. I'll report back tomorrow.
        Hide
        Martin Grigorov added a comment -

        Changed the return type to AbstractLink.
        Now you can return AjaxSubmitLink or any other AbtractLink type with AjaxFormSubmitBehavior attached.

        Show
        Martin Grigorov added a comment - Changed the return type to AbstractLink. Now you can return AjaxSubmitLink or any other AbtractLink type with AjaxFormSubmitBehavior attached.

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Paul Giblock
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 24h
              24h
              Remaining:
              Remaining Estimate - 24h
              24h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development