Ejemplo n.º 1
0
 @Override
 public void onKeyUp(KeyUpEvent event) {
   if (event.getSource().equals(txtBuscar.textBox)) {
     grid.getDataProvider().setFilter(txtBuscar.getText());
     grid.getDataProvider().refresh();
   } else if (event.getSource().equals(grid)) {
     if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER
         || event.getNativeEvent().getKeyCode() == KeyCodes.KEY_SPACE) {
       itemSelected();
     }
   }
 }
 @Override
 public void onKeyUp(KeyUpEvent event) {
   TextBox textBox = (TextBox) event.getSource();
   String input = textBox.getText();
   if (!input.matches("[0-9]*")) {
     textBox.setText("");
   }
 }
  @Override
  public final void onKeyUp(KeyUpEvent event) {
    if (event.getNativeKeyCode() != KeyCodes.KEY_TAB) {
      updateValue(event.getSource());

      validate();

      if (getState() != State.Initial) {
        setState(validate() ? State.Valid : State.Invalid);
      }
    }
  }
 @UiHandler({"fuf0", "fuf1", "fuf2", "fuf3", "fuf4"})
 void onFormKeyUp(KeyUpEvent event) {
   if ((event.getNativeKeyCode() == KeyCodes.KEY_BACKSPACE)
       || (event.getNativeKeyCode() == KeyCodes.KEY_DELETE)) {
     TextField tf = (TextField) event.getSource();
     for (IPCFileUploadField fuf : fufList) {
       String value = fuf.getValue();
       String currentValue = tf.getCurrentValue();
       if (value.equalsIgnoreCase(currentValue)) {
         fuf.clear();
         fuf.validate(true);
         break;
       }
     }
   }
 }