use of org.w3c.dom.html.HTMLFormElement in project intellij-plugins by StepicOrg.
the class StudyBrowserWindow method loadContent.
void loadContent(@NotNull String template, @NotNull Map<String, Object> params) {
String content = getContent(template, params);
Platform.runLater(() -> {
Document document = engine.getDocument();
if (document != null) {
HTMLFormElement form = (HTMLFormElement) document.getElementById("answer_form");
if (form != null) {
HTMLInputElement action = (HTMLInputElement) form.getElements().namedItem("action");
action.setValue("save_reply");
FormListener.handle(project, this, form);
}
}
engine.loadContent(content);
});
}
use of org.w3c.dom.html.HTMLFormElement in project intellij-plugins by StepicOrg.
the class FormListener method handleEvent.
@Override
public void handleEvent(Event event) {
String domEventType = event.getType();
if (EVENT_TYPE_SUBMIT.equals(domEventType)) {
HTMLFormElement form = (HTMLFormElement) event.getTarget();
handle(project, browser, form);
event.preventDefault();
event.stopPropagation();
}
}
Aggregations