/** * {@inheritDoc} */ @Override public void setAttributeNS(final String namespaceURI, final String qualifiedName, final String attributeValue) { super.setAttributeNS(namespaceURI, qualifiedName, attributeValue); // if value is changed and this element has the focus, then select the new value final Page page = getPage(); if (qualifiedName.equals("value") && page instanceof HtmlPage && ((HtmlPage) page).getFocusedElement() == this) { setSelectionStart(attributeValue.length()); setSelectionEnd(attributeValue.length()); } }
/** * {@inheritDoc} */ @Override public void setAttributeNS(final String namespaceURI, final String qualifiedName, final String attributeValue) { super.setAttributeNS(namespaceURI, qualifiedName, attributeValue); // if value is changed and this element has the focus, then select the new value final Page page = getPage(); if (qualifiedName.equals("value") && page instanceof HtmlPage && ((HtmlPage) page).getFocusedElement() == this) { setSelectionStart(attributeValue.length()); setSelectionEnd(attributeValue.length()); } }
/** * {@inheritDoc} */ @Override public void setAttributeNS(final String namespaceURI, final String qualifiedName, final String attributeValue) { super.setAttributeNS(namespaceURI, qualifiedName, attributeValue); // if value is changed and this element has the focus, then select the new value final Page page = getPage(); if (qualifiedName.equals("value") && page instanceof HtmlPage && ((HtmlPage) page).getFocusedElement() == this) { setSelectionStart(attributeValue.length()); setSelectionEnd(attributeValue.length()); } }
/** * {@inheritDoc} */ @Override protected void setAttributeNS(final String namespaceURI, final String qualifiedName, final String attributeValue, final boolean notifyAttributeChangeListeners, final boolean notifyMutationObservers) { super.setAttributeNS(namespaceURI, qualifiedName, attributeValue, notifyAttributeChangeListeners, notifyMutationObservers); if ("value".equals(qualifiedName)) { final SgmlPage page = getPage(); if (page != null && page.isHtmlPage()) { int pos = 0; if (!hasFeature(JS_INPUT_SET_VALUE_MOVE_SELECTION_TO_START)) { pos = attributeValue.length(); } setSelectionStart(pos); setSelectionEnd(pos); } } }
/** * {@inheritDoc} */ @Override protected void setAttributeNS(final String namespaceURI, final String qualifiedName, final String attributeValue, final boolean notifyAttributeChangeListeners, final boolean notifyMutationObservers) { super.setAttributeNS(namespaceURI, qualifiedName, attributeValue, notifyAttributeChangeListeners, notifyMutationObservers); if ("value".equals(qualifiedName)) { final SgmlPage page = getPage(); if (page != null && page.isHtmlPage()) { int pos = 0; if (!hasFeature(JS_INPUT_SET_VALUE_MOVE_SELECTION_TO_START)) { pos = attributeValue.length(); } setSelectionStart(pos); setSelectionEnd(pos); } } }