/** @return True to propagate further and false if the event was consumed. */ public boolean onMouseClick(ModelNode node) { if (logger.isLoggable(Level.INFO)) { logger.info("onMouseClick(): node=" + node + ",class=" + node.getClass().getName()); } if (node instanceof HTMLAbstractUIElement) { HTMLAbstractUIElement uiElement = (HTMLAbstractUIElement) node; Function f = uiElement.getOnclick(); if (f != null) { if (!Executor.executeFunction(uiElement, f)) { return false; } } } if (node instanceof HTMLLinkElementImpl) { ((HTMLLinkElementImpl) node).navigate(); return false; } else if (node instanceof HTMLButtonElementImpl) { HTMLButtonElementImpl button = (HTMLButtonElementImpl) node; String rawType = button.getAttribute("type"); String type; if (rawType == null) { type = "submit"; } else { type = rawType.trim().toLowerCase(); } if ("submit".equals(type)) { FormInput[] formInputs = new FormInput[] {new FormInput(button.getName(), button.getValue())}; button.submitForm(formInputs); } else if ("reset".equals(type)) { button.resetForm(); } else { // NOP for "button"! } return false; } ModelNode parent = node.getParentModelNode(); if (parent == null) { return true; } return this.onMouseClick(parent); }