Package org.apache.wicket.util.template

Examples of org.apache.wicket.util.template.PackageTextTemplate


        response.render(JavaScriptHeaderItem.forReference(
                new JavaScriptResourceReference(FileUploadBehavior.class, "jquery.fileupload-ui.js")));


        PackageTextTemplate jsTmpl = new PackageTextTemplate(FileUploadBehavior.class, "main.js");
        Map<String, Object> variables = new HashMap<String, Object>();

        variables.put("componentMarkupId", component.getMarkupId());
        variables.put("url", component.urlFor(new FileUploadResourceReference(WicketApplication.BASE_FOLDER), null));
        variables.put("paramName", PARAM_NAME);

        String s = jsTmpl.asString(variables);
        response.render(JavaScriptHeaderItem.forScript(s, "fileupload"));
    }
View Full Code Here


    final String contentType, final String encoding,
    IModel<Map<String, Object>> variablesModel, Locale locale, String style, String variation)
  {
    super(scope, fileName, locale, style, variation);

    textTemplate = new PackageTextTemplate(scope, fileName, contentType, encoding);
    this.variablesModel = variablesModel;

    if (Application.exists())
    {
      Application.get().getResourceReferenceRegistry().registerResourceReference(this);
View Full Code Here

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
      {

        CharSequence templateHtml = renderTemplate(new PackageTextTemplate(
          MailTemplate.class, "mail-template.tmpl"));
        updateResult(result, templateHtml, target);
        target.add(feedback);
      }
View Full Code Here

  {
    super.renderHead(component, response);

    response.render(JavaScriptHeaderItem.forReference(WicketWebSocketJQueryResourceReference.get()));

    PackageTextTemplate webSocketSetupTemplate =
        new PackageTextTemplate(WicketWebSocketJQueryResourceReference.class,
            "res/js/wicket-websocket-setup.js.tmpl");

    Map<String, Object> variables = Generics.newHashMap();

    // set falsy JS values for the non-used parameter
    if (Strings.isEmpty(resourceName))
    {
      int pageId = component.getPage().getPageId();
      variables.put("pageId", pageId);
      variables.put("resourceName", "");
    }
    else
    {
      variables.put("resourceName", resourceName);
      variables.put("pageId", false);
    }

    Url baseUrl = component.getRequestCycle().getUrlRenderer().getBaseUrl();
    CharSequence ajaxBaseUrl = Strings.escapeMarkup(baseUrl.toString());
    variables.put("baseUrl", ajaxBaseUrl);

    String contextPath = component.getRequest().getContextPath();
    variables.put("contextPath", contextPath);

    // preserve the application name for JSR356 based impl
    variables.put("applicationName", component.getApplication().getName());

    if (USING_JAVAX_WEB_SOCKET)
    {
      variables.put("filterPrefix", "");
    }
    else
    {
      variables.put("filterPrefix", component.getRequest().getFilterPath());
    }

    String webSocketSetupScript = webSocketSetupTemplate.asString(variables);

    response.render(OnDomReadyHeaderItem.forScript(webSocketSetupScript));
  }
View Full Code Here

    final String contentType, final String encoding,
    IModel<Map<String, Object>> variablesModel, Locale locale, String style, String variation)
  {
    super(scope, fileName, locale, style, variation);

    textTemplate = new PackageTextTemplate(scope, fileName, contentType, encoding);
    this.variablesModel = variablesModel;
  }
View Full Code Here

    StringBuilder calendarInit = new StringBuilder();
    appendMapping(p, calendarInit);
    variables.put("calendarInit", calendarInit.toString());

    // render initialization script with the variables interpolated
    TextTemplate datePickerJs = new PackageTextTemplate(DatePicker.class, "DatePicker.js");
    datePickerJs.interpolate(variables);
    response.renderOnDomReadyJavaScript(datePickerJs.asString());

    // remove previously generated markup (see onRendered) via javascript in
    // ajax requests to not render the yui calendar multiple times
    if (AjaxRequestTarget.get() != null)
    {
View Full Code Here

    {
      variables.put("filter", "");
      variables.put("allowRollup", true);
    }

    TextTemplate template = new PackageTextTemplate(DatePicker.class, key);
    response.renderOnDomReadyJavaScript(template.asString(variables));

    response.markRendered(key);
  }
View Full Code Here

      @Override
      protected void onSubmit(AjaxRequestTarget target, Form<?> form)
      {

        CharSequence templateHtml = renderTemplate(new PackageTextTemplate(
          MailTemplate.class, "mail-template.tmpl"));
        updateResult(result, templateHtml, target);
        target.add(feedback);
      }
View Full Code Here

    StringBuilder calendarInit = new StringBuilder();
    appendMapping(p, calendarInit);
    variables.put("calendarInit", calendarInit.toString());

    // render initialization script with the variables interpolated
    TextTemplate datePickerJs = new PackageTextTemplate(DatePicker.class, "DatePicker.js");
    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)
View Full Code Here

    {
      variables.put("filter", "");
      variables.put("allowRollup", true);
    }

    TextTemplate template = new PackageTextTemplate(DatePicker.class, key);
    response.render(OnDomReadyHeaderItem.forScript(template.asString(variables)));

    response.markRendered(key);
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.template.PackageTextTemplate

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.