Package org.apache.wicket.util.template

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


      }
    }
    variables.put("calendarInit", calendarInit.toString());

    // render initialization script with the variables interpolated
    TextTemplate datePickerJs = new PackagedTextTemplate(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) {
      final String javascript = "var e = Wicket.$('"
View Full Code Here


                "the same name as the class but with a '.js' extension and be present in " +
                "the same classpath location.",
                this.templateLocation));
        }
       
        TextTemplate tt = new PackageTextTemplate(
            this.template.getScope(),
            this.template.getName(),
            "application/javascript",
            settings().getEncoding()
        );
       
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("component", comp);
        map.put("behavior", this);
       
        this.readyScript = getCompressor().compress(
            PropertyVariableInterpolator.interpolate(tt.getString(), map)
        );
    }
View Full Code Here

  protected void onBeforeRender() {
    super.onBeforeRender();
    javaScriptId = getMarkupId();

    TextTemplate template = new PackagedTextTemplate(
            DragDropGroup.class, "init.js");
   
    add(TextTemplateHeaderContributor.forJavaScript(template, new AbstractReadOnlyModel(){

            @Override
View Full Code Here

    final Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("componentId", component.getMarkupId());
    variables.put("callbackUrl", getCallbackUrl());

    final TextTemplate verifyTemplate = new PackageTextTemplate(VerifyBehavior.class,
      "verify.js.tmpl");
    String asString = verifyTemplate.asString(variables);
    response.render(OnDomReadyHeaderItem.forScript(asString));
  }
View Full Code Here

    response.render(JavaScriptHeaderItem.forReference(TAG_IT_JS));

    component.setOutputMarkupId(true);
    String id = component.getMarkupId();

    TextTemplate tagItConfig = getTagItConfig();

    Map<String, CharSequence> variables = new HashMap<String, CharSequence>();
    variables.put("componentId", id);
    variables.put("callbackUrl", getCallbackUrl());

    String script = tagItConfig.asString(variables);

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

  protected void onBeforeRender() {
    super.onBeforeRender();
    javaScriptId = getMarkupId();

    TextTemplate template = new PackagedTextTemplate(
            DragDropGroup.class, "init.js");
   
    add(TextTemplateHeaderContributor.forJavaScript(template, new AbstractReadOnlyModel(){

            @Override
View Full Code Here

      }
    }
    variables.put("calendarInit", calendarInit.toString());

    // render initialization script with the variables interpolated
    TextTemplate datePickerJs = new PackagedTextTemplate(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("calendarInit", calendarInit.toString());

    // render initialization script with the variables interpolated
    TextTemplate datePickerJs = new PackagedTextTemplate(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

TOP

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

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.