2 /*******************************************************************************
3 * Copyright (c) 2012-2013 University of Stuttgart.
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * and the Apache License 2.0 which both accompany this distribution,
7 * and are available at http://www.eclipse.org/legal/epl-v10.html
8 * and http://www.apache.org/licenses/LICENSE-2.0
11 * Oliver Kopp - initial API and implementation and/or initial documentation
12 *******************************************************************************/
15 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
16 <%@taglib prefix="ct" tagdir="/WEB-INF/tags/common" %>
19 <c:when test="${empty it.requirementType.requiredCapabilityType}">
20 <c:set var="selected" value="(none)" />
23 <c:set var="selected" value="${it.requirementType.requiredCapabilityType}" />
27 <ct:QNameChooser allQNames="${it.allCapabilityTypes}" idOfSelectField="requiredCapabilityType" labelOfSelectField="" includeNONE="true" selected="${selected}"/>
30 $("#requiredCapabilityType").on("change", function(e) {
31 var val = $("#requiredCapabilityType").val();
32 if (val == "(none)") {
33 // remove required capability type assignment
35 url: 'requiredcapabilitytype',
37 }).fail(function(jqXHR, textStatus, errorThrown) {
38 vShowAJAXError("Could not remove required capability type assignment.", jqXHR, errorThrown);
39 }).done(function(data, textStatus, jqXHR) {
40 vShowSuccess("Successfully updated required capability type assignment.");
43 // put new capability type
45 url: 'requiredcapabilitytype',
47 contentType: "text/plain",
49 }).fail(function(jqXHR, textStatus, errorThrown) {
50 vShowAJAXError("Could not update required capability type assignment.", jqXHR, errorThrown);
51 }).done(function(data, textStatus, jqXHR) {
52 vShowSuccess("Successfully updated required capability type assignment.");