modules/enterprise/gui/installer-war/src/main/webapp/start.jsp | 17 ++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
New commits:
commit 14256b6e778bbb02703dd82e1804f69d2b639f64
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Dec 16 16:18:03 2011 -0500
[Bug 535538 - (RHQ-2222) Installer: db "Test Connection" button clears
password field]
An attempt to improve the situation by alerting the user, and not processing
"Test Connection" or "Install Server!" buttons, if the password
field
is empty.
- Note, the message displayed is in English since I'm not proficient enough
to figure out how to get javascript to interact with the resource bundle.
diff --git a/modules/enterprise/gui/installer-war/src/main/webapp/start.jsp
b/modules/enterprise/gui/installer-war/src/main/webapp/start.jsp
index c9aee8f..ad0219e 100644
--- a/modules/enterprise/gui/installer-war/src/main/webapp/start.jsp
+++ b/modules/enterprise/gui/installer-war/src/main/webapp/start.jsp
@@ -4,6 +4,7 @@
<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib
uri="http://java.sun.com/jsp/jstl/core" prefix="c"
%>
+
<f:view>
<f:loadBundle var="bundle" basename="InstallerMessages" />
@@ -19,6 +20,13 @@
var thisDiv = document.getElementById( _levelId );
thisDiv.style.display = "block";
}
+ function checkForPassword() {
+ if ( document.getElementById('propForm:databasepassword').value ==
'' ) {
+ alert("Please enter database password.");
+ return false;
+ }
+ return true;
+ }
</script>
</head>
@@ -144,6 +152,7 @@
<h:outputText value="#{bundle.testDatabaseNote}"
style="font-size: 100%"/>
<h:panelGrid columns="2">
<h:commandButton id="testDatabaseButton"
+ onclick="if (!checkForPassword()) return
false"
action="#{configurationBean.testConnection}"
value="#{bundle.testDatabaseButton}"/>
<h:panelGroup rendered="#{configurationBean.lastTest != null
&& configurationBean.lastTest != 'OK'}">
@@ -326,7 +335,11 @@
</tr></table>
--%>
<table border="1"><tr>
- <td><h:commandButton id="save"
action="#{configurationBean.save}" value="#{bundle.save}"
/></td>
+ <td><h:commandButton id="save"
+ onclick="if (!checkForPassword()) return false"
+ action="#{configurationBean.save}"
+ value="#{bundle.save}" />
+ </td>
</tr></table>
</p>
</h:form>
@@ -335,4 +348,4 @@
</html>
-</f:view>
\ No newline at end of file
+</f:view>