Package com.google.gwt.dom.client

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


      try
      {
        String name = element.getAttribute("name");
        if(name == null||name.isEmpty()||name.equals("jwchat_form_type"))
          continue;
        InputElement ie = (InputElement)element;
        String value = ie.getValue();
        if(value == null)
          value = "";
        String type = ie.getType();
        if(type == null)
          type = "";
       
        xml += "<field var='" +name + "'><value>";
       
        if(type.equals("checkbox"))
        {
          //InputElement ce = (InputElement)element;
          xml += ie.isChecked() ? "1":"0";
        }
        else
          xml += value;
        xml += "</value></field>";
      }
View Full Code Here


    String type = event.getType();

    boolean enterPressed = BrowserEvents.KEYDOWN.equals(type)
        && event.getKeyCode() == KeyCodes.KEY_ENTER;
    if (BrowserEvents.CHANGE.equals(type) || enterPressed) {
      InputElement input = parent.getFirstChild().cast();
      Boolean isChecked = input.isChecked();

      /*
       * Toggle the value if the enter key was pressed and the cell handles
       * selection or doesn't depend on selection. If the cell depends on
       * selection but doesn't handle selection, then ignore the enter key and
       * let the SelectionEventManager determine which keys will trigger a
       * change.
       */
      if (enterPressed && (handlesSelection() || !dependsOnSelection())) {
        isChecked = !isChecked;
        input.setChecked(isChecked);
      }

      /*
       * Save the new value. However, if the cell depends on the selection, then
       * do not save the value because we can get into an inconsistent state.
View Full Code Here

  @Override
  public Object onBrowserEvent(Element parent, String value, Object viewData,
      NativeEvent event, ValueUpdater<String> valueUpdater) {
    if (valueUpdater != null && "change".equals(event.getType())) {
      InputElement input = parent.getFirstChild().cast();
      valueUpdater.update(input.getValue());
    }

    return viewData;
  }
View Full Code Here

    }
  }

  protected String edit(Element parent, String value) {
    setValue(parent, value, value);
    InputElement input = (InputElement) parent.getFirstChild();
    input.focus();
    input.select();
    return value;
  }
View Full Code Here

    setValue(parent, value, null);
    return null;
  }

  private String commit(Element parent, ValueUpdater<String> valueUpdater) {
    InputElement input = (InputElement) parent.getFirstChild();
    String value = input.getValue();
    valueUpdater.update(value);
    return cancel(parent, value);
  }
View Full Code Here

  @Override
  public Object onBrowserEvent(Element parent, Boolean value, Object viewData,
      NativeEvent event, ValueUpdater<Boolean> valueUpdater) {
    String type = event.getType();
    if (valueUpdater != null && "change".equals(type)) {
      InputElement input = parent.getFirstChild().cast();
      valueUpdater.update(input.isChecked());
    }

    return viewData;
  }
View Full Code Here

    ClickHandler out = new ClickHandler() {
      public void onClick(ClickEvent event) {
        noSolution.setVisible(false);
        for (int r = 0; r < 9; r++) {
          for (int c = 0; c < 9; c++) {
            InputElement elt = getBox(r, c);
            elt.setValue("");
          }
        }
      }
    };
    return out;
View Full Code Here

        ajax.setVisible(true);
        int board[][] = new int[9][9];

        for (int r = 0; r < 9; r++) {
          for (int c = 0; c < 9; c++) {
            InputElement elt = getBox(r, c);

            int val = 0;
            String str = elt.getValue();
            if (str.length() == 1 && Character.isDigit(str.charAt(0))) {
              val = str.charAt(0) - '0';
            }

            board[r][c] = val;
View Full Code Here

    return out;
  }

  private InputElement getBox(int r, int c) {
    String cellname = "cell" + r + "" + c;
    InputElement elt = (InputElement) Document.get().getElementById(cellname);

    return elt;
  }
View Full Code Here

        }

        noSolution.setVisible(false);
        for (int r = 0; r < result.length; r++) {
          for (int c = 0; c < result[r].length; c++) {
            InputElement elt = getBox(r, c);
            elt.setValue(result[r][c] + "");
          }
        }
        ajax.setVisible(false);
      }
    };
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.