Files
yacos/YACOSWeb/WebContent/WEB-INF/jsp/addConference4.jsp
Frederic Debuire 8b0757c4ec Ajax pour l'ajout des utilisateurs
Policy failures:   
Code warning
- failed on resource AddConferenceController.java. Reason: HashSet is a raw type. References to generic type HashSet<E> should be parameterized, line 108
- failed on resource AddConferenceController.java. Reason: Iterator is a raw type. References to generic type Iterator<E> should be parameterized, line 61
- failed on resource AddConferenceController.java. Reason: Map is a raw type. References to generic type Map<K,V> should be parameterized, line 166
- failed on resource addConference4.jsp. Reason: No end tag (</fieldset>)., line 148
- failed on resource AddConferenceController.java. Reason: Set is a raw type. References to generic type Set<E> should be parameterized, line 108
... and more.  
Override reason:   
hehe
2008-01-28 16:53:14 +00:00

160 lines
4.0 KiB
Plaintext

<%@ include file="/WEB-INF/decorators/include.jsp"%>
<html>
<head>
<script type='text/javascript' src='./dwr/engine.js'></script>
<script type='text/javascript' src='./dwr/util.js'></script>
<script type='text/javascript' src='./dwr/interface/AddCriteriaJS.js'></script>
<script type='text/javascript' src='./javascripts/prototype.js'></script>
<script type='text/javascript'>
function init() {
fillTable();
}
var peopleCache = { };
var viewed = -1;
function fillTable() {
AddCriteriaJS.getAllCriteria(function(criteria) {
// Delete all the rows except for the "pattern" row
dwr.util.removeAllRows("criteriabody", { filter:function(tr) {
return (tr.id != "pattern");
}});
// Create a new set cloned from the pattern row
var person, id;
criteria.sort(function(p1, p2) { return p1.label.localeCompare(p2.label); });
if (criteria.length == 0)
$("tableCriterion").style.display = "none";
for (var i = 0; i < criteria.length; i++) {
person = criteria[i];
id = person.id;
dwr.util.cloneNode("pattern", { idSuffix:id });
dwr.util.setValue("tableCriterion" + id, person.label);
dwr.util.setValue("tableCriterionMin" + id, person.min);
dwr.util.setValue("tableCriterionMax" + id, person.max);
$("tableCriterion").style.display = "";
$("pattern" + id).style.display = "";
peopleCache[id] = person;
}
});
}
function editClicked(eleid) {
// we were an id of the form "edit{id}", eg "edit42". We lookup the "42"
var person = peopleCache[eleid.substring(4)];
dwr.util.setValues(person);
}
function deleteClicked(eleid) {
// we were an id of the form "delete{id}", eg "delete42". We lookup the "42"
var person = peopleCache[eleid.substring(6)];
if (confirm("Are you sure you want to delete " + person.label + "?")) {
dwr.engine.beginBatch();
AddCriteriaJS.deleteCriterion(person);
fillTable();
dwr.engine.endBatch();
}
}
function writePerson() {
var person = { id:viewed, label:null, min:null, max:null };
dwr.util.getValues(person);
dwr.engine.beginBatch();
AddCriteriaJS.setCriterion(person);
fillTable();
dwr.engine.endBatch();
}
function clearPerson() {
viewed = -1;
dwr.util.setValues({ id:-1, label:null, min:null, max:null });
}
function submitIfNotEnter(theForm){
if(theForm.elements["submit"] || theForm.elements["submit"]){
return true;
} else {
writePerson();
return false;
}
}
</script>
</head>
<body>
<h2 align="center"><fmt:message key="conference.titleMenu" /></h2>
<form:form commandName="formConference" name="monForm" onsubmit="return submitIfNotEnter(this)">
<fieldset><legend>Criteria</legend>
<table class="plain">
<tr>
<td>Label:</td>
<td><input id="label" type="text"/></td>
</tr>
<tr>
<td>Min:</td>
<td><input id="min" type="text"/></td>
</tr>
<tr>
<td>Max:</td>
<td><input id="max" type="text"/></td>
</tr>
<tr>
<td colspan="2" align="right"><small>(ID=<span id="id">-1</span>)</small>
<a href="#" onclick="writePerson()">Save</a>
<a href="#" onclick="clearPerson()">Clear</a>
</td>
</tr>
</table>
<br />
<table border="1" id="tableCriterion" style="display: none;">
<thead>
<tr>
<th>Criterion</th>
<th>Min</th>
<th>Max</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="criteriabody">
<tr id="pattern" style="display: none;">
<td><span id="tableCriterion">Criterion</span></td>
<td><span id="tableCriterionMin">Min</span></td>
<td><span id="tableCriterionMax">Max</span></td>
<td>
<a id="edit" href="#" onclick="editClicked(this.id)" >Edit</a>
<a id="delete" href="#" onclick="deleteClicked(this.id)" >Delete</a>
</td>
</tr>
</tbody>
</table>
<br />
<input type="submit" align="middle" name="_target2" value="Back" onclick="this.form.elements['submit']=true">
<input type="submit" align="middle" name="_target4" value="Next" onclick="this.form.elements['submit']=true" />
</form:form>
<script type="text/javascript">
init();
</script>
<br />
<br />
<a href="<c:url value="main.htm"/>">Home</a>
</body>
</html>