diff --git a/.travis.yml b/.travis.yml index e9b981e..b5f86e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ language: java jdk: - - oraclejdk8 \ No newline at end of file + - openjdk8 + \ No newline at end of file diff --git a/omod/src/main/java/org/openmrs/module/htmlwidgets/web/html/DateWidget.java b/omod/src/main/java/org/openmrs/module/htmlwidgets/web/html/DateWidget.java index 05e73a1..5b7e7de 100644 --- a/omod/src/main/java/org/openmrs/module/htmlwidgets/web/html/DateWidget.java +++ b/omod/src/main/java/org/openmrs/module/htmlwidgets/web/html/DateWidget.java @@ -12,10 +12,14 @@ public class DateWidget implements Widget { /** * @see Widget#render(WidgetConfig) */ + @Override public void render(WidgetConfig config, Writer w) throws IOException { HtmlUtil.renderResource(w, config.getRequest(), "/scripts/calendar/calendar.js"); + Object idPrefix = config.getId(); + config.setFixedAttribute("onchange", "disableButtons('" + idPrefix + "')"); + config.setFixedAttribute("onkeyup", "disableButtons('" + idPrefix + "')"); config.setFixedAttribute("size", "10"); config.setFixedAttribute("onClick", "showCalendar(this);"); diff --git a/omod/src/main/java/org/openmrs/module/htmlwidgets/web/html/TextAreaWidget.java b/omod/src/main/java/org/openmrs/module/htmlwidgets/web/html/TextAreaWidget.java index 445580f..12bdd33 100644 --- a/omod/src/main/java/org/openmrs/module/htmlwidgets/web/html/TextAreaWidget.java +++ b/omod/src/main/java/org/openmrs/module/htmlwidgets/web/html/TextAreaWidget.java @@ -13,7 +13,11 @@ public class TextAreaWidget implements Widget { /** * @see Widget#render(WidgetConfig) */ + @Override public void render(WidgetConfig config, Writer w) throws IOException { + + Object idPrefix = config.getId(); + config.setFixedAttribute("onkeyup", "disableButtons('" + idPrefix + "')"); config.setDefaultAttribute("cols", "20"); config.setDefaultAttribute("rows", "2"); HtmlUtil.renderOpenTag(w, "textarea", config.getAttributes()); diff --git a/omod/src/main/java/org/openmrs/module/htmlwidgets/web/html/TextWidget.java b/omod/src/main/java/org/openmrs/module/htmlwidgets/web/html/TextWidget.java index 92751a8..132a63f 100644 --- a/omod/src/main/java/org/openmrs/module/htmlwidgets/web/html/TextWidget.java +++ b/omod/src/main/java/org/openmrs/module/htmlwidgets/web/html/TextWidget.java @@ -10,7 +10,11 @@ public class TextWidget implements Widget { /** * @see Widget#render(WidgetConfig) */ + @Override public void render(WidgetConfig config, Writer w) throws IOException { + + Object idPrefix = config.getId(); + config.setFixedAttribute("onkeyup", "disableButtons('" + idPrefix + "')"); String textValue = config.getDefaultValue() == null ? "" : config.getDefaultValue().toString(); config.setFixedAttribute("type", "text"); config.setDefaultAttribute("value", textValue);