Ejemplo n.º 1
0
  private void searchFieldDisabled() {
    isDisabled = selectElement.isDisabled();
    if (isDisabled) {
      container.addClass(css.chznDisabled());
      InputElement.as(searchField.get(0)).setDisabled(true);
      if (!isMultiple) {
        selectedItem.unbind("focus", activateAction);
      }

    } else {
      container.removeClass(css.chznDisabled());
      InputElement.as(searchField.get(0)).setDisabled(false);
      if (!isMultiple) {
        selectedItem.bind("focus", activateAction);
      }
    }
  }
Ejemplo n.º 2
0
  public List<String> getFilenames() {
    ArrayList<String> result = new ArrayList<String>();

    JavaScriptObject rawFileList = getElement().getPropertyJSO("files");
    if (rawFileList == null) {
      result.add(InputElement.as(getElement()).getValue()); // IE does not support multiple-select
    } else {
      FileList fileList = rawFileList.cast();
      for (int i = 0; i < fileList.getLength(); ++i) {
        result.add(fileList.item(i).getName());
      }
    }

    return result;
  }
Ejemplo n.º 3
0
 /**
  * This constructor may be used by subclasses to explicitly use an existing element. This element
  * must be an &lt;input&gt; element whose type is 'file'.
  *
  * @param element the element to be used
  */
 protected FileUpload(Element element) {
   assert InputElement.as(element).getType().equalsIgnoreCase("file");
   setElement(element);
 }