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

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


      {
        fail("Link " + path + "is an AjaxLink and will " +
          "not be invoked when AJAX (javascript) is disabled.");
      }

      AjaxLink link = (AjaxLink)linkComponent;

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

      link.onClick(target);

      // process the request target
      processRequestCycle(requestCycle);
    }
    // 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 = new AjaxRequestTarget(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


        return !hidden;
      }
    };
    add(containerWrapper);
    containerWrapper.add(getBodyContainer());
    add(new AjaxLink("hideLink")
    {
      private static final long serialVersionUID = 1L;

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

                jaiCache.setMemoryCapacity(capacityBefore);
                updateModel();
            }
        });

        add(new AjaxLink("clear.resourceCache") {
            @Override
            public void onClick(AjaxRequestTarget target) {
                Catalog cat = getCatalog();
                try {
                    cat.getResourcePool().dispose();
                    info(getLocalizer().getString("resourceCacheClearedSuccessfully", this));
                }
                catch( Exception e ) {
                    error(e);
                }
                target.addComponent(feedbackPanel);
            }
        });
       
        add(new AjaxLink("reload.catalogConfig") {
            @Override
            public void onClick(AjaxRequestTarget target) {
                try {
                    GeoServerLoader loader = GeoServerExtensions.bean(GeoServerLoader.class);
                    synchronized (org.geoserver.config.GeoServer.CONFIGURATION_LOCK) {
View Full Code Here

    /**
     * Constructs the panel with a link containing an image and a label.
     */
    public ImageAjaxLink( String id, ResourceReference imageRef, String label ) {
        super( id );
        link = new AjaxLink( "link" ) {
            @Override
            public void onClick(AjaxRequestTarget target) {
                ImageAjaxLink.this.onClick(target);
            }
        };
View Full Code Here

                return null;
            }
        }.setFilterable( false ));
        layerTable.setOutputMarkupId( true );
       
        add( new AjaxLink( "add" ) {
            @Override
            public void onClick(AjaxRequestTarget target) {
                popupWindow.setInitialHeight( 375 );
                popupWindow.setInitialWidth( 525 );
                popupWindow.setTitle(new ParamResourceModel("chooseLayer", this));
View Full Code Here

            }
        };
    }

    private AjaxLink flatViewLink() {
        return new AjaxLink("flatView", new PropertyModel(getModel(), "flatView")) {
            private static final long serialVersionUID = 6747039733052048287L;

            @Override
            public void onClick(final AjaxRequestTarget target) {
                setModelObject(Boolean.TRUE);
View Full Code Here

            }
        };
    }

    private AjaxLink treeViewLink() {
        return new AjaxLink("treeView", new PropertyModel(getModel(), "flatView")) {
            private static final long serialVersionUID = 6747039733052048287L;

            @Override
            public void onClick(final AjaxRequestTarget target) {
                setModelObject(Boolean.FALSE);
View Full Code Here

            }
        };
    }

    private AjaxLink collapseAllLink() {
        return new AjaxLink("collapseAll") {
            private static final long serialVersionUID = 6747039733052048287L;

            @Override
            public void onClick(final AjaxRequestTarget target) {
                keyTreePanel.collapseAll(target);
View Full Code Here

            }
        };
    }

    private AjaxLink expandAllLink() {
        return new AjaxLink("expandAll") {
            private static final long serialVersionUID = 6747039733052048287L;

            @Override
            public void onClick(final AjaxRequestTarget target) {
                keyTreePanel.expandAll(target);
View Full Code Here

        form.add(mimetype);
        form.setMarkupId("mainForm");
        add(form);

       
        AjaxLink cancelLink = new AjaxLink( "cancel" ) {
            @Override
            public void onClick(AjaxRequestTarget target) {
                setResponsePage( ProxyAdminPage.class );
            }
        };
View Full Code Here

TOP

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

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.