@Override public boolean isAutofocus() { return this.getInputElement().isAutofocus(); }
@Override public boolean checkValidity() { return this.getInputElement().checkValidity(); }
@Override public String getAutocomplete() { return this.getInputElement().getAutocomplete(); }
@Override public void setFocusOnFirstWidget() { // implementation sets focus on first input element with autofocus attribute final NodeList<Element> elements = Document.get().getElementsByTagName("input"); for (int i = 0; i < elements.getLength(); i++) { final InputElement element = elements.getItem(i).cast(); if (element.isAutofocus()) { element.focus(); break; } } }
/** * Gets the maximum allowable length of the text box. * * @return the maximum length, in characters */ public int getMaxLength() { return getInputElement().getMaxLength(); }
@Override public String getPattern() { return this.getInputElement().getPattern(); }
@Override protected void onEnsureDebugId(final String pbaseId) { super.onEnsureDebugId(pbaseId); if (!this.nativeSupport) { WebshimResources.whenReady(event -> { Scheduler.get().scheduleFixedDelay(() -> { this.getJQueryElement().updatePolyfill(); GWT.log("Initialize webshim for: " + getElement().getId()); try { this.getJQueryElement().getShadowElement().addEventListener(Event.CHANGE, listener -> ValueChangeEvent.fire(this, getValue())); } catch (final Exception exception) { GWT.log(exception.getMessage()); } return false; }, 1000); }); } }
@Override public void setFocusOnFirstWidget() { // implementation sets focus on first input element with autofocus attribute final NodeList<Element> elements = Document.get().getElementsByTagName("input"); for (int i = 0; i < elements.getLength(); i++) { final InputElement element = elements.getItem(i).cast(); if (element.isAutofocus()) { element.focus(); break; } } }
/** * Gets the maximum allowable length. * * @return the maximum length, in characters */ public int getMaxLength() { return getInputElement().getMaxLength(); }
@Override public String getPattern() { return this.getInputElement().getPattern(); }
@Override protected void onEnsureDebugId(final String pbaseId) { super.onEnsureDebugId(pbaseId); if (!this.nativeSupport) { WebshimResources.whenReady(event -> { Scheduler.get().scheduleFixedDelay(() -> { this.getJQueryElement().updatePolyfill(); GWT.log("Initialize webshim for: " + getElement().getId()); try { this.getJQueryElement().getShadowElement().addEventListener(Event.CHANGE, listener -> ValueChangeEvent.fire(this, getValue())); } catch (final Exception exception) { GWT.log(exception.getMessage()); } return false; }, 1000); }); } }
@Override public boolean isAutofocus() { return this.getInputElement().isAutofocus(); }
/** * Gets the maximum allowable length of the text box. * * @return the maximum length, in characters */ public int getMaxLength() { return getInputElement().getMaxLength(); }
@Override public boolean checkValidity() { return this.getInputElement().checkValidity(); }
@Override public boolean isAutofocus() { final elemental.dom.Element headElement = getElement().cast(); final NodeList inputElements = headElement.getElementsByTagName("input"); final InputElement input = (InputElement) inputElements.at(0); return input.isAutofocus(); }
/** * Gets the maximum allowable length. * * @return the maximum length, in characters */ public int getMaxLength() { return getInputElement().getMaxLength(); }