Wicket
  1. Wicket
  2. WICKET-4327

wickettester should have getajaxrequestarget

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 1.5.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      wicket 1.5.3

      Description

      currently wickettester doesnt have something like getAjaxrequesttarget() ,its needed for the case where you have to test the components added in ART,
      it can be done easily by saving the target in ART.respond(requestcycle) in some object foreg.i did this in local wicket copy
      public enum LastAjaxTarget {
      INSTANCE;
      public AjaxRequestTarget getTarget()

      { return target; }

      public void setTarget(AjaxRequestTarget target)

      { this.target = target; }

      AjaxRequestTarget target;
      }

      and in ART.respond(requestcycle), i just call the setter and provides the current ART , so wickettester or anything can access the LastAjaxTarget..

      thanks
      Vineet Semwal

        Issue Links

          Activity

          Hide
          Martin Grigorov added a comment -

          One more example that https://issues.apache.org/jira/browse/WICKET-4326 will make it easier for such cases.
          With IAjaxRequestHandler you will be able to setup custom one with org.apache.wicket.protocol.http.WebApplication#setAjaxRequestTargetProvider() and override its add() method to collect what you have added.

          Show
          Martin Grigorov added a comment - One more example that https://issues.apache.org/jira/browse/WICKET-4326 will make it easier for such cases. With IAjaxRequestHandler you will be able to setup custom one with org.apache.wicket.protocol.http.WebApplication#setAjaxRequestTargetProvider() and override its add() method to collect what you have added.
          Hide
          Martin Grigorov added a comment -

          You can save the ART in your own IRequestCycleListener.
          Override org.apache.wicket.request.cycle.IRequestCycleListener#onRequestHandlerResolved() and save it.

          tester.getApplication().getRequestCycleListeners().add(yourListener);

          later:
          ART target = yourListener.getART();

          Show
          Martin Grigorov added a comment - You can save the ART in your own IRequestCycleListener. Override org.apache.wicket.request.cycle.IRequestCycleListener#onRequestHandlerResolved() and save it. tester.getApplication().getRequestCycleListeners().add(yourListener); later: ART target = yourListener.getART();
          Hide
          vineet semwal added a comment -

          martin-g:somehow that doesnt work,i see other handlers getting resolved but not ajaxrequesttarget so i added new AjaxRequestTarget.IListener in tester,.getApplication().getAjaxRequestTargetListeners().add(listener) and it worked,thanks for the advice..

          Show
          vineet semwal added a comment - martin-g:somehow that doesnt work,i see other handlers getting resolved but not ajaxrequesttarget so i added new AjaxRequestTarget.IListener in tester,.getApplication().getAjaxRequestTargetListeners().add(listener) and it worked,thanks for the advice..

            People

            • Assignee:
              Unassigned
              Reporter:
              vineet semwal
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development