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

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


   * 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

  public AjaxEditableLabelPage()
  {
    final AjaxEditableLabel ajaxLabel = new AjaxEditableLabel("ajaxLabel",
      new Model<String>("ajaxTest"));
    add(ajaxLabel);
    add(new AjaxLink("toggle")
    {
      private static final long serialVersionUID = 1L;

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

   */
  public void testDisabledAjaxEditableLabel()
  {
    Page page = tester.getLastRenderedPage();
    AjaxEditableLabel ajaxLabel = (AjaxEditableLabel)page.get("ajaxLabel");
    AjaxLink toggle = (AjaxLink)page.get("toggle");

    AbstractAjaxBehavior toggleBehavior = (AbstractAjaxBehavior)toggle.getBehaviors().get(0);

    // check for correct rendering
    tester.assertInvisible("ajaxLabel:editor");
    tester.assertVisible("ajaxLabel:label");

View Full Code Here

    final MockPageWithLinkAndComponent page = new MockPageWithLinkAndComponent();

    page.add(new WebComponent(MockPageWithLinkAndComponent.COMPONENT_ID).setOutputMarkupId(true));


    page.add(new AjaxLink(MockPageWithLinkAndComponent.LINK_ID)
    {
      private static final long serialVersionUID = 1L;

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

        propertiesContainer.add(connectorPropForm);

        connectorForm.add(propertiesContainer);
        connectorPropForm.add(view);

        final AjaxLink check = new IndicatingAjaxLink("check", new ResourceModel("check")) {

            private static final long serialVersionUID = -7978723352517770644L;

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

        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

    private <T extends AbstractSchemaModalPage> AjaxLink getCreateSchemaWindow(final ModalWindow createSchemaWin,
            final AttributableType attributableType, final SchemaModalPageFactory.SchemaType schemaType,
            final String winLinkName, final String winName, final String createPermissions) {

        AjaxLink createSchemaWinLink = new IndicatingAjaxLink(winLinkName) {

            private static final long serialVersionUID = -7978723352517770644L;

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

        editConfigWin.setCookieName("edit-configuration-modal");

        setWindowClosedCallback(createConfigWin, confContainer);
        setWindowClosedCallback(editConfigWin, confContainer);

        AjaxLink createConfigurationLink = new AjaxLink("createConfigurationLink") {

            private static final long serialVersionUID = -7978723352517770644L;

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

        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

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.