Search in sources :

Example 1 with HTMLInputElement

use of elemental2.dom.HTMLInputElement in project gwt-react-examples by GWTReact.

the class StatefulExample method doChange.

private void doChange(FormEvent event) {
    HTMLInputElement e = (HTMLInputElement) event.target;
    String val = e.value;
    setState(State.make(val));
}
Also used : HTMLInputElement(elemental2.dom.HTMLInputElement)

Example 2 with HTMLInputElement

use of elemental2.dom.HTMLInputElement in project gwt-react-examples by GWTReact.

the class TodoItem method componentDidUpdate.

/**
 * Safely manipulate the DOM after updating the state when invoking
 * `props.onEdit()` in the `handleEdit` method above.
 * For more info refer to notes at https://facebook.github.io/react/docs/component-api.html#setstate
 * and https://facebook.github.io/react/docs/component-specs.html#updating-componentdidupdate
 */
public void componentDidUpdate(TodoItemProps prevProps, TodoItemProps prevState) {
    if (!prevProps.isEditing && props.isEditing) {
        HTMLInputElement inputEl = (HTMLInputElement) this.refs.get("editField");
        inputEl.focus();
        inputEl.select();
    }
}
Also used : HTMLInputElement(elemental2.dom.HTMLInputElement)

Example 3 with HTMLInputElement

use of elemental2.dom.HTMLInputElement in project gwt-react-examples by GWTReact.

the class StatefulExample method doChange.

private void doChange(FormEvent event) {
    HTMLInputElement e = (HTMLInputElement) event.target;
    String val = e.value;
    setState(State.make(val));
}
Also used : HTMLInputElement(elemental2.dom.HTMLInputElement)

Example 4 with HTMLInputElement

use of elemental2.dom.HTMLInputElement in project kie-wb-common by kiegroup.

the class TimePicker method bind.

public void bind(final HTMLInputElement input) {
    this.inputBind = input;
    final HTMLElement viewElement = view.getElement();
    ElementHelper.insertAfter(viewElement, input);
    input.onclick = this::inputOnClick;
    previousCallback = input.onblur;
    input.onblur = this::inputOnBlur;
    viewElement.scrollTop = input.scrollTop;
    viewElement.scrollLeft = input.scrollLeft;
    view.setOnBlur(this::onViewElementBlur);
    view.setOnDateChanged(this::onDateChanged);
}
Also used : HTMLElement(elemental2.dom.HTMLElement)

Example 5 with HTMLInputElement

use of elemental2.dom.HTMLInputElement in project kie-wb-common by kiegroup.

the class ReassignmentsEditorWidgetTest method testOneReassignment.

@Test
public void testOneReassignment() {
    values.setValues(new ArrayList<>());
    values.addValue(new ReassignmentValue());
    Assert.assertEquals(1, values.getValues().size());
    Assert.assertFalse(values.isEmpty());
    reassignmentsEditorWidget.setValue(values);
    Assert.assertEquals(1, values.getValues().size());
    Assert.assertEquals(1, reassignmentsEditorWidget.getValue().getValues().size());
    HTMLInputElement input = getFieldValue(ReassignmentsEditorWidget.class, reassignmentsEditorWidget, "reassignmentsTextBox");
    Assert.assertEquals("1 reassignments", input.value);
}
Also used : HTMLInputElement(elemental2.dom.HTMLInputElement) ReassignmentValue(org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentValue) Test(org.junit.Test) ReflectionUtilsTest(org.kie.workbench.common.stunner.bpmn.client.forms.util.ReflectionUtilsTest)

Aggregations

HTMLInputElement (elemental2.dom.HTMLInputElement)12 Test (org.junit.Test)6 ReflectionUtilsTest (org.kie.workbench.common.stunner.bpmn.client.forms.util.ReflectionUtilsTest)4 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Before (org.junit.Before)2 NotificationValue (org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue)2 ReassignmentValue (org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentValue)2 HTMLElement (elemental2.dom.HTMLElement)1 NotificationTypeListValue (org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationTypeListValue)1 ReassignmentTypeListValue (org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentTypeListValue)1