예제 #1
0
  /**
   * Render the upload tags.
   *
   * @param writer Writer to output markup
   */
  protected void beginRender(MarkupWriter writer) {
    formSupport.setEncodingType(MULTIPART_ENCTYPE);

    writer.element(
        "input", "type", "file", "name", getControlName(), "id", getClientId(), "class", cssClass);

    validate.render(writer);

    resources.renderInformalParameters(writer);

    decorateInsideField();

    // TAPESTRY-2453
    if (request.isXHR()) {
      javaScriptSupport.require("t5/core/injected-upload").with(getClientId());
    }
  }
예제 #2
0
  void beginRender(MarkupWriter writer) {
    writer.element("select", "name", getControlName(), "id", getClientId());

    putPropertyNameIntoBeanValidationContext("value");

    validate.render(writer);

    removePropertyNameFromBeanValidationContext();

    resources.renderInformalParameters(writer);

    decorateInsideField();

    // Disabled is via a mixin

    if (this.zone != null) {
      Link link = resources.createEventLink(CHANGE_EVENT);

      JSONObject spec =
          new JSONObject("selectId", getClientId(), "zoneId", zone, "url", link.toURI());

      javascriptSupport.addInitializerCall("linkSelectToZone", spec);
    }
  }
예제 #3
0
파일: DateField.java 프로젝트: hlship/tapx
  public void beginRender(MarkupWriter writer) {
    String value = tracker.getInput(this);

    if (value == null) {
      value = formatCurrentValue();
    }

    String clientId = getClientId();
    String triggerId = clientId + "-trigger";

    writer.element(
        "input",
        "type",
        hideTextField ? "hidden" : "text",
        "name",
        getControlName(),
        "id",
        clientId,
        "value",
        value);

    if (isDisabled()) {
      writer.attributes("disabled", "disabled");
    }

    validate.render(writer);

    resources.renderInformalParameters(writer);

    decorateInsideField();

    writer.end();

    // Now the trigger icon.

    writer.element(
        "img",
        "id",
        triggerId,
        "class",
        "t-calendar-trigger",
        "src",
        icon.toClientURL(),
        "alt",
        "[Show]");
    writer.end(); // img

    writeTimeZone(writer);

    JSONObject spec =
        new JSONObject(
                "clientId", clientId, "clientDateFormat", formatConverter.convertToClient(format))
            .put("time", time)
            .put("singleClick", singleClick);

    if (max != null) {
      spec.put("max", convertDateToClientTimeZone(max).getTime());
    }

    if (min != null) {
      spec.put("min", convertDateToClientTimeZone(min).getTime());
    }

    javascriptSupport.addInitializerCall("tapxDateField", spec);
  }