Examples of AjaxLink


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

        editNotificationWin.setCookieName("edit-notification-modal");

        setWindowClosedCallback(createNotificationWin, notificationContainer);
        setWindowClosedCallback(editNotificationWin, notificationContainer);

        AjaxLink createNotificationLink = new AjaxLink("createNotificationLink") {

            private static final long serialVersionUID = -7978723352517770644L;

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

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

        // ---------------------------

        // ---------------------------
        // Link to select schemas/columns to be shown
        // ---------------------------
        final AjaxLink displayAttrsLink = new IndicatingAjaxLink("displayAttrsLink") {

            private static final long serialVersionUID = -7978723352517770644L;

            @Override
            public void onClick(final AjaxRequestTarget target) {

                displaymodal.setPageCreator(new ModalWindow.PageCreator() {

                    private static final long serialVersionUID = -7834632442532690940L;

                    @Override
                    public Page createPage() {
                        return new DisplayAttributesModalPage(page.getPageReference(), displaymodal);
                    }
                });

                displaymodal.show(target);
            }
        };

        // Add class to specify relative position of the link.
        // Position depends on result pages number.
        displayAttrsLink.add(new Behavior() {

            private static final long serialVersionUID = 1469628524240283489L;

            @Override
            public void onComponentTag(final Component component, final ComponentTag tag) {
View Full Code Here

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

                    });
                    reportletConfWin.show(target);
                }
            }
        });
        reportlets.setAddLink(new AjaxLink(ADD_BUTTON_ID) {

            private static final long serialVersionUID = -7978723352517770644L;
           
            @Override
            public void onClick(final AjaxRequestTarget target) {
                reportletConfWin.setPageCreator(new ModalWindow.PageCreator() {

                    private static final long serialVersionUID = -7834632442532690940L;

                    @Override
                    public Page createPage() {
                        modalReportletConfOldName = null;
                        modalReportletConf = null;
                        return new ReportletConfModalPage(null, reportletConfWin,
                                ReportModalPage.this.getPageReference());
                    }
                });
                reportletConfWin.show(target);
            }
        });
        reportlets.setEditLink(new AjaxLink(EDIT_BUTTON_ID) {

            private static final long serialVersionUID = -7978723352517770644L;

            @Override
            public void onClick(final AjaxRequestTarget target) {
                target.focusComponent(this);
            }

            @Override
            protected IAjaxCallDecorator getAjaxCallDecorator() {
                return new AjaxPreprocessingCallDecorator(super.getAjaxCallDecorator()) {

                    private static final long serialVersionUID = -7927968187160354605L;

                    @Override
                    public CharSequence preDecorateScript(final CharSequence script) {
                        return script + reportlets.getEditOnClickJS();
                    }
                };
            }
        });
        reportlets.setRemoveLink(new AjaxLink(REMOVE_BUTTON_ID) {

            private static final long serialVersionUID = -7978723352517770644L;

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

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

        Fragment selfRegFrag;
        if (isSelfRegistrationAllowed()) {
            selfRegFrag = new Fragment("selfRegistration", "selfRegAllowed", this);

            final AjaxLink selfRegLink = new IndicatingAjaxLink("link") {

                private static final long serialVersionUID = -7978723352517770644L;

                @Override
                public void onClick(final AjaxRequestTarget target) {
                    editProfileModalWin.setPageCreator(new ModalWindow.PageCreator() {

                        private static final long serialVersionUID = -7834632442532690940L;

                        @Override
                        public Page createPage() {
                            return new UserRequestModalPage(Login.this.getPageReference(), editProfileModalWin,
                                    new UserTO(), UserModalPage.Mode.SELF);
                        }
                    });

                    editProfileModalWin.show(target);
                }
            };
            selfRegLink.add(new Label("linkTitle", getString("selfRegistration")));

            Panel panel = new LinkPanel("selfRegistration", new ResourceModel("selfRegistration"));
            panel.add(selfRegLink);
            selfRegFrag.add(panel);
        } else {
View Full Code Here

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

        });

        paginatorForm.add(rowsChooser);
        add(paginatorForm);

        AjaxLink createLink = new IndicatingAjaxLink("createLink") {

            private static final long serialVersionUID = -7978723352517770644L;

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

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

   *
   */
  public void testAssertComponentOnAjaxResponse()
  {
    final Page page = new MockPageWithLink();
    AjaxLink ajaxLink = new AjaxLink(MockPageWithLink.LINK_ID)
    {
      private static final long serialVersionUID = 1L;

      public void onClick(AjaxRequestTarget target)
      {
        // Replace the link with a normal Link
        Link link = new Link(MockPageWithLink.LINK_ID)
        {
          private static final long serialVersionUID = 1L;

          public void onClick()
          {
            // Do nothing
          }
        };
        link.setOutputMarkupId(true);

        page.replace(link);

        target.addComponent(link);
      }
    };
    ajaxLink.setOutputMarkupId(true);

    page.add(ajaxLink);

    tester.startPage(new ITestPageSource()
    {
View Full Code Here

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

    labelModel.setObject("Label 1");
    final Label label = new Label(MockPageWithLinkAndLabel.LABEL_ID, labelModel);
    label.setOutputMarkupId(true);

    final Page page = new MockPageWithLinkAndLabel();
    AjaxLink ajaxLink = new AjaxLink(MockPageWithLinkAndLabel.LINK_ID)
    {
      private static final long serialVersionUID = 1L;

      public void onClick(AjaxRequestTarget target)
      {
        labelModel.setObject("Label which needs encoding: [] ][");
        target.addComponent(label);
      }
    };
    ajaxLink.setOutputMarkupId(true);

    page.add(ajaxLink);
    ajaxLink.add(label);

    tester.startPage(new ITestPageSource()
    {
      private static final long serialVersionUID = 1L;
View Full Code Here

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

   * Tests page expired.
   */
  public void testExpirePage()
  {
    tester.startPage(TestExpirePage.class);
    AjaxLink link = (AjaxLink)tester.getComponentFromLastRenderedPage("link");

    // Cannot use executeAjaxEvent or onClick because WicketTester creates
    // an AjaxRequestTarget from scratch
    // tester.executeAjaxEvent(link, "onclick");
    // tester.clickLink("link");

    // FIXME should not be needed
    tester.createRequestCycle();

    // Clear the session to remove the pages
    tester.getWicketSession().invalidateNow();

    // Invoke the call back URL of the ajax event behavior
    String callbackUrl = ((AjaxEventBehavior)link.getBehaviors().get(0)).getCallbackUrl()
      .toString();
    tester.setupRequestAndResponse();

    // Fake an Ajax request
    (tester.getServletRequest()).addHeader("Wicket-Ajax", "Yes");
View Full Code Here

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

   * Tests internal error page.
   */
  public void testInternalErrorPage()
  {
    tester.startPage(TestErrorPage.class);
    AjaxLink link = (AjaxLink)tester.getComponentFromLastRenderedPage("link");

    // Cannot use executeAjaxEvent or onClick because WicketTester creates
    // an AjaxRequestTarget from scratch
    // tester.executeAjaxEvent(link, "onclick");
    // tester.clickLink("link");

    // FIXME should not be needed
    tester.createRequestCycle();

    // Invoke the call back URL of the ajax event behavior
    String callbackUrl = ((AjaxEventBehavior)link.getBehaviors().get(0)).getCallbackUrl()
      .toString()
      .replaceAll("&", "&");
    tester.setupRequestAndResponse();
    // Fake an Ajax request
    (tester.getServletRequest()).addHeader("Wicket-Ajax", "Yes");
View Full Code Here

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

        getRequestCycle().setResponsePage(new ResultPage("A special label"));
      }
    });

    // AjaxLink
    add(new AjaxLink("ajaxLinkWithSetResponsePageClass")
    {
      private static final long serialVersionUID = 1L;

      public void onClick(AjaxRequestTarget target)
      {
        getRequestCycle().setResponsePage(ResultPage.class);
      }
    });

    add(new AjaxLink("ajaxLinkWithSetResponsePage")
    {
      private static final long serialVersionUID = 1L;

      public void onClick(AjaxRequestTarget target)
      {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.