Package org.apache.wicket.ajax

Examples of org.apache.wicket.ajax.AjaxRequestTarget


    @Override
    public void onEvent(final IEvent<?> event) {
        if (event.getPayload() instanceof DetailsModEvent) {
            // connectro change: update properties and forward event
            final AjaxRequestTarget target = ((ResourceEvent) event.getPayload()).getTarget();

            connConfProperties = getConnConfProperties();
            check.setEnabled(!connConfProperties.isEmpty());

            target.add(connConfPropContainer);

            // get configuration properties and send a new event
            send(getPage(), Broadcast.BREADTH, new ConnConfModEvent(target, connConfProperties));

        } else if (event.getPayload() instanceof MultiValueSelectorEvent) {
            // multi value connector property change: forward event
            final AjaxRequestTarget target = ((MultiValueSelectorEvent) event.getPayload()).getTarget();

            send(getPage(), Broadcast.BREADTH, new ConnConfModEvent(target, connConfProperties));
        }
    }
View Full Code Here


    @Override
    public void onEvent(final IEvent<?> event) {

        if (event.getPayload() instanceof ConnConfModEvent) {

            final AjaxRequestTarget target = ((ConnConfModEvent) event.getPayload()).getTarget();

            final List<ConnConfProperty> conf = ((ConnConfModEvent) event.getPayload()).getConfiguration();

            mappings.removeAll();

            addMappingBtn.setEnabled(resourceTO.getConnectorId() != null && resourceTO.getConnectorId() > 0);

            schemaNames = getResourceSchemaNames(resourceTO.getConnectorId(), new HashSet<ConnConfProperty>(conf));

            target.add(mappingContainer);
        }
    }
View Full Code Here

    datePickerJs.interpolate(variables);
    response.render(OnDomReadyHeaderItem.forScript(datePickerJs.asString()));

    // remove previously generated markup (see onRendered) via javascript in
    // ajax requests to not render the yui calendar multiple times
    AjaxRequestTarget target = component.getRequestCycle().find(AjaxRequestTarget.class);
    if (target != null)
    {
      String escapedComponentMarkupId = getEscapedComponentMarkupId();
      String javascript = "var e = Wicket.$('" + escapedComponentMarkupId + "Dp" +
        "'); if (e != null && typeof(e.parentNode) != 'undefined' && " +
        "typeof(e.parentNode.parentNode != 'undefined')) {" +
        "e.parentNode.parentNode.removeChild(e.parentNode);" + "YAHOO.wicket." +
        escapedComponentMarkupId + "DpJs.destroy(); delete YAHOO.wicket." +
        escapedComponentMarkupId + "DpJs;}";

      target.prependJavaScript(javascript);
    }
  }
View Full Code Here

      AjaxLink<?> link = (AjaxLink<?>)linkComponent;

      setupRequestAndResponse(true);
      WebRequestCycle requestCycle = createRequestCycle();
      callOnBeginRequest(requestCycle);
      AjaxRequestTarget target = getApplication().newAjaxRequestTarget(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 = getApplication().newAjaxRequestTarget(link.getPage());
      requestCycle.setRequestTarget(target);

      link.onClick(target);

      // process the request target
View Full Code Here

    Integer pageId = pageKey.getPageId();
    Page page = (Page) Session.get().getPageManager().getPage(pageId);
    if (page != null)
    {
      page.dirty();
      AjaxRequestTarget target = application.newAjaxRequestTarget(page);
      executeHandlers(target, page);
    }
    else
    {
      LOGGER.warn("Could not find a page with id '{}' for session with id '{}' in the page stores. It will be unregistered",
View Full Code Here

        final IsisUiHintEvent uiHintEvent = IsisEnvelopeEvent.openLetter(event, IsisUiHintEvent.class);
        if(uiHintEvent == null) {
            return;
        }
        addSubscribingLink(uiHintEvent.getUiHintContainer());
        final AjaxRequestTarget target = uiHintEvent.getTarget();
        if(target != null) {
            target.add(subscribingLink);
        }
    }
View Full Code Here

    @Override
    public void onEvent(final IEvent<?> event) {
        if (event.getPayload() instanceof DetailsModEvent) {
            // connectro change: update properties and forward event
            final AjaxRequestTarget target = ((ResourceEvent) event.getPayload()).getTarget();

            connConfProperties = getConnConfProperties();
            check.setEnabled(!connConfProperties.isEmpty());

            target.add(connConfPropContainer);

            // get configuration properties and send a new event
            send(getPage(), Broadcast.BREADTH, new ConnConfModEvent(target, connConfProperties));

        } else if (event.getPayload() instanceof MultiValueSelectorEvent) {
            // multi value connector property change: forward event
            final AjaxRequestTarget target = ((MultiValueSelectorEvent) event.getPayload()).getTarget();

            send(getPage(), Broadcast.BREADTH, new ConnConfModEvent(target, connConfProperties));
        }
    }
View Full Code Here

    datePickerJs.interpolate(variables);
    response.render(OnDomReadyHeaderItem.forScript(datePickerJs.asString()));

    // remove previously generated markup (see onRendered) via javascript in
    // ajax requests to not render the yui calendar multiple times
    AjaxRequestTarget target = component.getRequestCycle().find(AjaxRequestTarget.class);
    if (target != null)
    {
      String escapedComponentMarkupId = getEscapedComponentMarkupId();
      String javascript = "var e = Wicket.$('" + escapedComponentMarkupId + "Dp" +
        "'); if (e != null && typeof(e.parentNode) != 'undefined' && " +
        "typeof(e.parentNode.parentNode != 'undefined')) {" +
        "e.parentNode.parentNode.removeChild(e.parentNode);" + "YAHOO.wicket." +
        escapedComponentMarkupId + "DpJs.destroy(); delete YAHOO.wicket." +
        escapedComponentMarkupId + "DpJs;}";

      target.prependJavaScript(javascript);
    }
  }
View Full Code Here

    @Override
    public void onEvent(final IEvent<?> event) {

        if (event.getPayload() instanceof ConnConfModEvent) {

            final AjaxRequestTarget target = ((ConnConfModEvent) event.getPayload()).getTarget();

            final List<ConnConfProperty> conf = ((ConnConfModEvent) event.getPayload()).getConfiguration();

            mappings.removeAll();

            addMappingBtn.setEnabled(resourceTO.getConnectorId() != null && resourceTO.getConnectorId() > 0);

            schemaNames = getResourceSchemaNames(resourceTO.getConnectorId(), new HashSet<ConnConfProperty>(conf));

            target.add(mappingContainer);
        }
    }
View Full Code Here

      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
View Full Code Here

TOP

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

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.