Package org.apache.wicket.ajax.markup.html

Examples of org.apache.wicket.ajax.markup.html.AjaxFallbackLink


        throw new RuntimeException("Link's id needs to be 'link' ");
      }
    }
    else if (action instanceof IYuiMenuAjaxAction)
    {
      link = new AjaxFallbackLink(LINK_ID, action.getName())
      {
        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target)
View Full Code Here


  @SuppressWarnings("unchecked")
  @Override
  protected WebMarkupContainer newLink(String linkId, final int index)
  {
    return new AjaxFallbackLink(linkId)
    {

      @Override
      public void onClick(AjaxRequestTarget target)
      {
View Full Code Here

    // AjaxFallbackLinks is processed like an AjaxLink if isAjax is true
    // If it's not handling of the linkComponent is passed through to the
    // Link.
    else if (linkComponent instanceof AjaxFallbackLink && isAjax)
    {
      AjaxFallbackLink link = (AjaxFallbackLink)linkComponent;

      setupRequestAndResponse(true);
      WebRequestCycle requestCycle = createRequestCycle();
      AjaxRequestTarget target = getApplication().newAjaxRequestTarget(link.getPage());
      requestCycle.setRequestTarget(target);

      link.onClick(target);

      // process the request target
      processRequestCycle(requestCycle);
    }
    // if the link is an AjaxSubmitLink, we need to find the form
    // from it using reflection so we know what to submit.
    else if (linkComponent instanceof AjaxSubmitLink)
    {
      // If it's not ajax we fail
      if (isAjax == false)
      {
        fail("Link " + path + "is an AjaxSubmitLink and " +
          "will not be invoked when AJAX (javascript) is disabled.");
      }

      AjaxSubmitLink link = (AjaxSubmitLink)linkComponent;

      // We cycle through the attached behaviors and select the
      // LAST matching behavior as the one we handle.
      List behaviors = link.getBehaviors();
      AjaxFormSubmitBehavior ajaxFormSubmitBehavior = null;
      for (Iterator iter = behaviors.iterator(); iter.hasNext();)
      {
        Object behavior = iter.next();
        if (behavior instanceof AjaxFormSubmitBehavior)
View Full Code Here

                // odd/even alternate style
                item.add(new SimpleAttributeModifier("class",
                        item.getIndex() % 2 == 0 ? "even" : "odd"));
               
                // navigation/selection links
                AjaxFallbackLink link = new IndicatingAjaxFallbackLink("nameLink") {

                    @Override
                    public void onClick(AjaxRequestTarget target) {
                        linkNameClicked((File) item.getModelObject(), target);
                    }
                   
                };
                link.add(new Label("name", item.getModel()) {
                    @Override
                    public IConverter getConverter(Class type) {
                        return FILE_NAME_CONVERTER;
                    }
                });
View Full Code Here

    // AjaxFallbackLinks is processed like an AjaxLink if isAjax is true
    // If it's not handling of the linkComponent is passed through to the
    // Link.
    else if (linkComponent instanceof AjaxFallbackLink && isAjax)
    {
      AjaxFallbackLink link = (AjaxFallbackLink)linkComponent;

      setupRequestAndResponse();
      RequestCycle requestCycle = createRequestCycle();
      AjaxRequestTarget target = new AjaxRequestTarget(link.getPage());
      requestCycle.setRequestTarget(target);

      link.onClick(target);

      // process the request target
      target.respond(requestCycle);
    }
    // if the link is an AjaxSubmitLink, we need to find the form
    // from it using reflection so we know what to submit.
    else if (linkComponent instanceof AjaxSubmitLink)
    {
      // If it's not ajax we fail
      if (isAjax == false)
      {
        fail("Link " + path + "is an AjaxSubmitLink and " +
            "will not be invoked when AJAX (javascript) is disabled.");
      }

      AjaxSubmitLink link = (AjaxSubmitLink)linkComponent;

      // We cycle through the attached behaviors and select the
      // LAST matching behavior as the one we handle.
      List behaviors = link.getBehaviors();
      AjaxFormSubmitBehavior ajaxFormSubmitBehavior = null;
      for (Iterator iter = behaviors.iterator(); iter.hasNext();)
      {
        Object behavior = iter.next();
        if (behavior instanceof AjaxFormSubmitBehavior)
View Full Code Here

        }
      };
    }
    else
    {
      return new AjaxFallbackLink(id)
      {
        private static final long serialVersionUID = 1L;

        /**
         * @see org.apache.wicket.ajax.markup.html.AjaxFallbackLink#onClick(org.apache.wicket.ajax.AjaxRequestTarget)
View Full Code Here

        }
      };
    }
    else
    {
      return new AjaxFallbackLink(id)
      {
        private static final long serialVersionUID = 1L;

        /**
         * @see org.apache.wicket.ajax.markup.html.AjaxFallbackLink#onClick(org.apache.wicket.ajax.AjaxRequestTarget)
View Full Code Here

      super(id);
      ListView lv = new ListView("file", new PackagedResourcesModel())
      {
        protected void populateItem(ListItem item)
        {
          AjaxFallbackLink link = new AjaxFallbackLink("link", item.getModel())
          {
            public void onClick(AjaxRequestTarget target)
            {
              setName(getModelObjectAsString());

              if (target != null)
              {
                target.addComponent(codePanel);
                target.addComponent(filename);
              }
            }
          };
          link.add(new Label("name", item.getModelObjectAsString()));
          item.add(link);
        }
      };
      add(lv);
    }
View Full Code Here

    // AjaxFallbackLinks is processed like an AjaxLink if isAjax is true
    // If it's not handling of the linkComponent is passed through to the
    // Link.
    else if (linkComponent instanceof AjaxFallbackLink && isAjax)
    {
      AjaxFallbackLink link = (AjaxFallbackLink)linkComponent;

      setupRequestAndResponse(true);
      RequestCycle requestCycle = createRequestCycle();
      AjaxRequestTarget target = new AjaxRequestTarget(link.getPage());
      requestCycle.setRequestTarget(target);

      link.onClick(target);

      // process the request target
      target.respond(requestCycle);
      requestCycle.detach();
    }
    // if the link is an AjaxSubmitLink, we need to find the form
    // from it using reflection so we know what to submit.
    else if (linkComponent instanceof AjaxSubmitLink)
    {
      // If it's not ajax we fail
      if (isAjax == false)
      {
        fail("Link " + path + "is an AjaxSubmitLink and " +
          "will not be invoked when AJAX (javascript) is disabled.");
      }

      AjaxSubmitLink link = (AjaxSubmitLink)linkComponent;

      // We cycle through the attached behaviors and select the
      // LAST matching behavior as the one we handle.
      List behaviors = link.getBehaviors();
      AjaxFormSubmitBehavior ajaxFormSubmitBehavior = null;
      for (Iterator iter = behaviors.iterator(); iter.hasNext();)
      {
        Object behavior = iter.next();
        if (behavior instanceof AjaxFormSubmitBehavior)
View Full Code Here

    // AjaxFallbackLinks is processed like an AjaxLink if isAjax is true
    // If it's not handling of the linkComponent is passed through to the
    // Link.
    else if (linkComponent instanceof AjaxFallbackLink && isAjax)
    {
      AjaxFallbackLink link = (AjaxFallbackLink)linkComponent;

      setupRequestAndResponse();
      RequestCycle requestCycle = createRequestCycle();
      AjaxRequestTarget target = new AjaxRequestTarget();
      requestCycle.setRequestTarget(target);

      link.onClick(target);

      // process the request target
      target.respond(requestCycle);
    }
    // if the link is an AjaxSubmitLink, we need to find the form
    // from it using reflection so we know what to submit.
    else if (linkComponent instanceof AjaxSubmitLink)
    {
      // If it's not ajax we fail
      if (isAjax == false)
      {
        fail("Link " + path + "is an AjaxSubmitLink and "
            + "will not be invoked when AJAX (javascript) is disabled.");
      }

      AjaxSubmitLink link = (AjaxSubmitLink)linkComponent;

      // We cycle through the attached behaviors and select the
      // LAST matching behavior as the one we handle.
      List behaviors = link.getBehaviors();
      AjaxFormSubmitBehavior ajaxFormSubmitBehavior = null;
      for (Iterator iter = behaviors.iterator(); iter.hasNext();)
      {
        Object behavior = iter.next();
        if (behavior instanceof AjaxFormSubmitBehavior)
View Full Code Here

TOP

Related Classes of org.apache.wicket.ajax.markup.html.AjaxFallbackLink

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.