Esempio n. 1
0
  Object defaultBlankLabel() {
    Messages containerMessages = resources.getContainerMessages();

    String key = resources.getId() + "-blanklabel";

    if (containerMessages.contains(key)) return containerMessages.get(key);

    return null;
  }
Esempio n. 2
0
  @SuppressWarnings("unchecked")
  SelectModel defaultModel() {
    Class valueType = resources.getBoundType("value");

    if (valueType == null) return null;

    if (Enum.class.isAssignableFrom(valueType))
      return new EnumSelectModel(valueType, resources.getContainerMessages());

    return null;
  }
Esempio n. 3
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);
    }
  }