Package org.apache.wicket.ajax

Examples of org.apache.wicket.ajax.AjaxEventBehavior


    Args.notNull(component, "component");
    Args.notNull(event, "event");

    checkUsability(component, true);

    AjaxEventBehavior ajaxEventBehavior = WicketTesterHelper.findAjaxEventBehavior(component,
      event);
    executeBehavior(ajaxEventBehavior);
  }
View Full Code Here


  {
    // Setup mocks
    final MockPageWithOneComponent page = new MockPageWithOneComponent();

    Label label = new Label("component", "Dblclick This To See Magick");
    label.add(new AjaxEventBehavior("ondblclick")
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onEvent(AjaxRequestTarget target)
View Full Code Here

   *            the name of the default event on which this link will listen to
   * @return the ajax behavior which will be executed when the user clicks the link
   */
  protected AjaxEventBehavior newAjaxEventBehavior(final String event)
  {
    return new AjaxEventBehavior(event)
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onEvent(final AjaxRequestTarget target)
View Full Code Here

    animalSelectionLabel.setOutputMarkupId(true);
    add(animalSelectionLabel);

    // Image referencing captcha image resource
    image = new NonCachingImage("image", imageResource = new CaptchaImageResource(animals));
    image.add(new AjaxEventBehavior("click")
    {
      private static final long serialVersionUID = 7480352029955897654L;

      @Override
      protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
View Full Code Here

    public static final String TEST_QUERY_STRING = "&query_p_1=value_1";

    /** */
    public EscapeTestPage()
    {
      getTextField().add(new AjaxEventBehavior("onchange")
      {
        private static final long serialVersionUID = 1L;

        @Override
        public CharSequence getCallbackUrl()
View Full Code Here

   * @return the first behavior for this event, or {@code null}
   */
  public static AjaxEventBehavior findAjaxEventBehavior(Component component, String event)
  {
    List<AjaxEventBehavior> behaviors = findAjaxEventBehaviors(component, event);
    AjaxEventBehavior behavior = null;
    if (behaviors != null && behaviors.isEmpty() == false)
    {
      behavior = behaviors.get(0);
    }
    return behavior;
View Full Code Here

   *            the name of the default event on which this link will listen to
   * @return the ajax behavior which will be executed when the user clicks the link
   */
  protected AjaxEventBehavior newAjaxEventBehavior(String event)
  {
    return new AjaxEventBehavior(event)
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onEvent(AjaxRequestTarget target)
View Full Code Here

    animalSelectionLabel.setOutputMarkupId(true);
    add(animalSelectionLabel);

    // Image referencing captcha image resource
    image = new NonCachingImage("image", imageResource = new CaptchaImageResource(animals));
    image.add(new AjaxEventBehavior("click")
    {
      private static final long serialVersionUID = 7480352029955897654L;

      @Override
      protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
View Full Code Here

  {
    // Setup mocks
    final MockPageWithOneComponent page = new MockPageWithOneComponent();

    Label label = new Label("component", "Dblclick This To See Magick");
    label.add(new AjaxEventBehavior("ondblclick")
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onEvent(AjaxRequestTarget target)
View Full Code Here

        " Component: " + component + "; Event: " + event);
    }

    // Run through all the behavior and select the LAST ADDED behavior which
    // matches the event parameter.
    AjaxEventBehavior ajaxEventBehavior = null;
    List<IBehavior> behaviors = component.getBehaviors();
    for (IBehavior behavior : behaviors)
    {
      // AjaxEventBehavior is the one to look for
      if (behavior instanceof AjaxEventBehavior)
      {
        AjaxEventBehavior tmp = (AjaxEventBehavior)behavior;
        if (event.equals(tmp.getEvent()))
        {
          ajaxEventBehavior = tmp;
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.wicket.ajax.AjaxEventBehavior

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.