Package org.apache.wicket.ajax.json

Examples of org.apache.wicket.ajax.json.JSONStringer


  private Boolean selectOnBlur;
  private Boolean dropdownAutoWidth;

  public CharSequence toJson() {
    try {
      JSONStringer writer = new JSONStringer();
      writer.object();
      Json.writeObject(writer, "minimumInputLength", minimumInputLength);
      Json.writeObject(writer, "minimumResultsForSearch", minimumResultsForSearch);
      Json.writeObject(writer, "maximumSelectionSize", maximumSelectionSize);
      Json.writeObject(writer, "placeholder", placeholder);
      Json.writeObject(writer, "allowClear", allowClear);
      Json.writeObject(writer, "multiple", multiple);
      Json.writeObject(writer, "closeOnSelect", closeOnSelect);
      Json.writeFunction(writer, "id", id);
      Json.writeFunction(writer, "matcher", matcher);
      Json.writeFunction(writer, "tokenizer", tokenizer);
      Json.writeFunction(writer, "sortResults", sortResults);
      Json.writeFunction(writer, "formatSelection", formatSelection);
      Json.writeFunction(writer, "formatResult", formatResult);
      Json.writeFunction(writer, "formatNoMatches", formatNoMatches);
      Json.writeFunction(writer, "formatInputTooShort", formatInputTooShort);
      Json.writeFunction(writer, "formatResultCssClass", formatResultCssClass);
      Json.writeFunction(writer, "formatSelectionTooBig", formatSelectionTooBig);
      Json.writeFunction(writer, "formatLoadMore", formatLoadMore);
      Json.writeFunction(writer, "formatSearching", formatSearching);
      Json.writeFunction(writer, "escapeMarkup", escapeMarkup);
      Json.writeFunction(writer, "createSearchChoice", createSearchChoice);
      Json.writeFunction(writer, "initSelection", initSelection);
      Json.writeFunction(writer, "query", query);
      Json.writeObject(writer, "width", width);
      Json.writeObject(writer, "openOnEnter", openOnEnter);
      Json.writeFunction(writer, "containerCss", containerCss);
      Json.writeObject(writer, "containerCssClass", containerCssClass);
      Json.writeFunction(writer, "dropdownCss", dropdownCss);
      Json.writeObject(writer, "dropdownCssClass", dropdownCssClass);
      Json.writeObject(writer, "separator", separator);
      Json.writeObject(writer, "tokenSeparators", tokenSeparators);
      Json.writeObject(writer, "selectOnBlur", selectOnBlur);
      Json.writeObject(writer, "dropdownAutoWidth", dropdownAutoWidth);
      if (ajax != null) {
        writer.key("ajax");
        ajax.toJson(writer);
      }
      Json.writeFunction(writer, "data", data);
      Json.writeFunction(writer, "tags", tags);
      writer.endObject();

      return writer.toString();
    } catch (JSONException e) {
      throw new RuntimeException("Could not convert Select2 settings object to Json", e);
    }
  }
View Full Code Here


  private String optionsJsonString()
  {
    String optionsJsonString = "";
    try
    {
      JSONWriter writer = new JSONStringer().object();
      for (String key : options.keySet())
      {
        writer.key(key).value(options.get(key));
      }
      writer.endObject();
View Full Code Here

TOP

Related Classes of org.apache.wicket.ajax.json.JSONStringer

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.