Package com.google.gwt.dom.client

Examples of com.google.gwt.dom.client.InputElement


    }
    setValue(true);
  }

  private void replaceInputElement(Element elem) {
    InputElement newInputElem = InputElement.as(elem);

    int tabIndex = getTabIndex();
    boolean checked = getValue();
    boolean enabled = isEnabled();
    String uid = input.getId();
View Full Code Here


    if (rendered) {
      List<M> l = new ArrayList<M>();
      NodeList<Element> nodes = el().select(checkBoxSelector);
      for (int i = 0; i < nodes.getLength(); i++) {
        if (InputElement.is(nodes.getItem(i))) {
          InputElement e = InputElement.as(nodes.getItem(i));
          if (e.isChecked()) {
            l.add(getStore().getAt(i));
          }
        }
      }
      return l;
View Full Code Here

      NodeList<Element> nodes = el().select(checkBoxSelector);
      int index = store.indexOf(m);
      if (index != -1) {
        Element e = nodes.getItem(index);
        if (InputElement.is(e)) {
          InputElement i = InputElement.as(e);
          i.setChecked(checked);
        }
      }
    } else {
      if (checkedPreRender == null) {
        checkedPreRender = new ArrayList<M>();
View Full Code Here

      // handle double clicks to enter edit more
      if ("dblclick".equals(type)) {
        beginEdit(context, parent, value);

        beginningEdit = true;
        InputElement input = getInputElement(parent);
        input.focus();
        beginningEdit = false;
      }

      // when not in edit mode - handle click events on the cell
      if ("click".equals(type)) {

        EventTarget eventTarget = event.getEventTarget();
        Element clickedElement = Element.as(eventTarget);
        String tagName = clickedElement.getTagName();

        // check whether the checkbox was clicked
        if (tagName.equals("INPUT")) {

          // if so, synchronize the model state
          InputElement input = clickedElement.cast();
          value.setCompleted(input.isChecked());
          eventBus.fireEvent(new ToDoUpdatedEvent(value));

          // update the 'row' style
          if (input.isChecked()) {
            getViewRootElement(parent).addClassName("completed");
          } else {
            getViewRootElement(parent).removeClassName("completed");
          }
View Full Code Here

  /**
   * Commits the changes in text value to the ToDoItem
   */
  private void commitEdit(Element parent, ToDoItem value) {
    InputElement input = getInputElement(parent);
    value.setTitle(input.getValue());
    eventBus.fireEvent(new ToDoUpdatedEvent(value));
  }
View Full Code Here

            NodeList<Node> childNodes = getElement().getChildNodes();
            String id = null;
            for (int i = 0; i < childNodes.getLength(); i++) {
                Node item = childNodes.getItem(i);
                if (item.getNodeName().toLowerCase().equals("input")) {
                    InputElement input = (InputElement) item;
                    id = input.getId();
                }
                if (item.getNodeName().toLowerCase().equals("label")) {
                    LabelElement label = (LabelElement) item;
                    if (breakLink) {
                        label.setHtmlFor("");
View Full Code Here

    replaceInputElement(DOM.createInputRadio(name));

  }

  private void replaceInputElement(Element elem) {
    InputElement newInputElem = InputElement.as(elem);
    // Collect information we need to set

    boolean checked = getValue();
    boolean enabled = isEnabled();
    String formValue = getFormValue();
View Full Code Here

    gq.attr("type", "radio");
    assertEquals("radio", InputElement.as(gq.get(0)).getType());
    assertEquals("blop", InputElement.as(gq.get(0)).getValue());

    gq.attr(Properties.create("{class:'test2', disabled:true}"));
    InputElement ie = InputElement.as(gq.get(0));

    assertEquals("test2", ie.getClassName());
    assertEquals(true, ie.isDisabled());
    assertEquals("disabled", ie.getAttribute("disabled"));

  }
View Full Code Here

  protected String getEquivalentTagName(){
    return "input";
  }

  protected void copyAttributes(Element src, Element dest) {
    InputElement source = src.cast();
    InputElement destination = dest.cast();

    destination.setAccessKey(source.getAccessKey());
    destination.setDefaultValue(source.getDefaultValue());
    destination.setDisabled(source.isDisabled());
    if (source.getMaxLength() > 0) destination.setMaxLength(source.getMaxLength());
    destination.setReadOnly(source.isReadOnly());
    destination.setSize(source.getSize());
    destination.setName(source.getName());
    destination.setValue(source.getValue());
  }
View Full Code Here

        throw new RuntimeException(
            "You cannot change type of button or input element if the element is already attached to the dom");
      }
      if ("input".equals(tag.toLowerCase()) && "radio".equals(value)) {
        //some browser (IE6-9) resets value property of the input when you change the type to radio button
        InputElement ie = InputElement.as(e);
        String keepValue = ie.getValue();
        super.setAttribute(ie, "type", value);
        ie.setValue(keepValue);
      } else {
        super.setAttribute(e, name, value);
      }
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.dom.client.InputElement

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.