SlicDiagWeb/src/main/webapp
diff -u -r1.5 -r1.6
--- dbSelect.jsp 13 Dec 2007 00:39:48 -0000 1.5
+++ dbSelect.jsp 14 Dec 2007 19:06:31 -0000 1.6
@@ -264,6 +264,13 @@
submitData(theForm, tableId);
}
+ function submitAndPlotData(theForm, tableId) {
+ submitData(theForm, tableId);
+
+ // Redirect to the Plots tab
+ top.location = "index.jsp?tab=plots.jsp#top";
+ }
+
function submitData(theForm, tableId) {
prepareData(theForm, tableId);
//alert("Submit?");
@@ -285,7 +292,7 @@
// Check if this file has already been added
for (var i=1; i<lastRow; i++) {
- var val = tbl.rows[i].cells[2].firstChild.nodeValue;
+ var val = tbl.rows[i].cells[3].firstChild.nodeValue;
if (val == file) {
alert("File has already been added: "+file+" \nNo action taken.");
return false;
@@ -318,11 +325,13 @@
sel.name = 'selRow' + lastRow;
for (var ii=0; ii<colorsArr.length; ii++) {
var opt = new Option(colorsArr[ii], colorsArr[ii]);
- opt.style.background = colorsArr[ii];
+ opt.style.backgroundColor = colorsArr[ii];
sel.options[ii] = opt;
}
sel.selectedIndex = lastRow-1;
+ sel.onchange= function(event) {changeBackground(this)};
cellRightSel.appendChild(sel);
+ sel.style.backgroundColor = sel.options[sel.selectedIndex].style.backgroundColor;
// "File" cell
var cell = row.insertCell(3);
@@ -341,6 +350,12 @@
//alert("info: "+theForm.name);
return false;
}
+
+ function changeBackground(sel) {
+ //alert(sel.options[sel.selectedIndex].style.backgroundColor);
+ sel.style.backgroundColor = sel.options[sel.selectedIndex].style.backgroundColor;
+ toggleId('warningId', true);
+ }
</SCRIPT>
</head>
<body>
@@ -386,9 +401,9 @@
<TR>
<TD>
- <c:out value="${arrDisp[fn:length(arrDisp)-1]}"/>:
+ <b>${arrDisp[fn:length(arrDisp)-1]}</b>:
</TD>
- <TD COLSPAN="5">
+ <TD COLSPAN="4">
<SELECT ID="${arrDisp[fn:length(arrDisp)-1]}" name="${arrDisp[fn:length(arrDisp)-1]}">
<c:set var="v" value="${aida:createList(data.rows, arrDB[fn:length(arrDisp)-1], false)}"/>
${aida:sortList(v, true)}
@@ -400,7 +415,7 @@
</SELECT>
</TD>
<TD>
- <button style="background-color: #fea;" onclick="addFile('${arrDisp[fn:length(arrDisp)-1]}', 'dataTable')"><b>Add</b></button>
+ <button title="Add this File to the selected Data table" style="background-color: #fea;" onclick="addFile('${arrDisp[fn:length(arrDisp)-1]}', 'dataTable')"><b>Select Data</b></button>
</TD>
<TD>
<button style="background-color: #fea;" onclick="resetForm(this.form)">Reset Form</button>
@@ -425,11 +440,14 @@
<input type="hidden" name="full_selection" value="${initParam.full_selection}"/>
</form>
- <br><h3>Selected Data:</h3>
+ <br><br><h3>Selected Data:</h3>
+
<form name="dataSubmitForm" action="dbSelect.jsp">
- <button style="background-color: orange;" onclick="clearData(this.form, 'dataTable')">Clear Data</button>
+ <button title="Save selection and go to the Plot page" style="background-color: orange;" onclick="submitAndPlotData(this.form, 'dataTable')"><b>Plot Data</b></button>
+
+ <button title="Save selection" style="background-color: orange;" onclick="submitData(this.form, 'dataTable')">Save Data</button>
- <button style="background-color: orange;" onclick="submitData(this.form, 'dataTable')"><b>Submit</b></button>
+ <button title="Clear selection" style="background-color: orange;" onclick="clearData(this.form, 'dataTable')">Clear Data</button>
<c:set var="arrRes" value="${fn:split(initParam.namesResult, ' ')}" />
<TABLE ID="dataTable">
<TR>
@@ -457,9 +475,12 @@
/>
</TD>
<TD>
- <SELECT name="color${arrItems[0]}" id="color${arrItems[0]}" onchange="toggleId('warningId', true)">
+ <SELECT style="background-color: ${arrItems[2]};" name="color${arrItems[0]}" id="color${arrItems[0]}" onChange="changeBackground(this);">
<c:forEach var="obj" items="${arrColors}">
- <OPTION style="background-color: ${obj};" value="${obj}" <c:if test="${arrItems[2] == obj}"> selected</c:if> >
+ <OPTION style="background-color: ${obj};" value="${obj}"
+ <c:if test="${arrItems[2] == obj}">
+ selected
+ </c:if> >
<c:out value="${obj}"/>
</OPTION>
</c:forEach>
@@ -483,7 +504,7 @@
<TR><TD>
<font size=+2>
<b>You've made changes to the data selection. If you want save it,<br>
- don't forget to push "Submit" or "Clear" button before leaving this page! </b>
+ don't forget to push "Plot Data" or "Save Data" button before leaving this page! </b>
</font>
</TD></TR>
</TABLE>