oldInputElement.setAccessKey("");
// Quickly do the actual replace
final Element parent = oldInputElement.getParentElement().cast();
final int index = DOM.getChildIndex(parent, (Element) oldInputElement.cast());
parent.removeChild(oldInputElement);
DOM.insertChild(parent, (Element) newElement.cast(), index);
this.invokeReplaceElement(newElement);
// Setup the new element
DOM.sinkEvents((Element) oldInputElement.cast(), DOM.getEventsSunk(this.getElement()));