Subversion Repositories Sigmater

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6 Andrea 1
<#--
2
/*
3
 * $Id: Action.java 502296 2007-02-01 17:33:39Z niallp $
4
 *
5
 * Licensed to the Apache Software Foundation (ASF) under one
6
 * or more contributor license agreements.  See the NOTICE file
7
 * distributed with this work for additional information
8
 * regarding copyright ownership.  The ASF licenses this file
9
 * to you under the Apache License, Version 2.0 (the
10
 * "License"); you may not use this file except in compliance
11
 * with the License.  You may obtain a copy of the License at
12
 *
13
 *  http://www.apache.org/licenses/LICENSE-2.0
14
 *
15
 * Unless required by applicable law or agreed to in writing,
16
 * software distributed under the License is distributed on an
17
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18
 * KIND, either express or implied.  See the License for the
19
 * specific language governing permissions and limitations
20
 * under the License.
21
 */
22
-->
23
<script type="text/javascript">
24
	function autoPopulate_${parameters.escapedId?html}(targetElement) {
25
		<#if parameters.headerKey?exists && parameters.headerValue?exists>
26
		if (targetElement.options[targetElement.selectedIndex].value == '${parameters.headerKey?html}') {
27
			return;
28
		}			
29
		</#if>
30
		<#if parameters.emptyOption?default(false)>
31
		if (targetElement.options[targetElement.selectedIndex].value == '') {
32
		    return;
33
		}
34
		</#if>
35
		targetElement.form.elements['${parameters.name?html}'].value=targetElement.options[targetElement.selectedIndex].value;
36
	}
37
</script>
38
<#include "/${parameters.templateDir}/simple/text.ftl" />
39
<br />
40
<#if parameters.list?exists>
41
<select onChange="autoPopulate_${parameters.escapedId?html}(this);"<#rt/>
42
    <#if parameters.disabled?default(false)>
43
 disabled="disabled"<#rt/>
44
    </#if>
45
>
46
	<#if (parameters.headerKey?exists && parameters.headerValue?exists)>
47
		<option value="${parameters.headerKey?html}">${parameters.headerValue?html}</option>
48
	</#if>
49
	<#if parameters.emptyOption?default(false)>
50
	    <option value=""></option>
51
	</#if>
52
    <@s.iterator value="parameters.list">
53
    <#if parameters.listKey?exists>
54
    	<#assign tmpListKey = stack.findString(parameters.listKey) />
55
    <#else>
56
    	<#assign tmpListKey = stack.findString('top') />
57
    </#if>
58
    <#if parameters.listValue?exists>
59
    	<#assign tmpListValue = stack.findString(parameters.listValue) />
60
    <#else>
61
    	<#assign tmpListValue = stack.findString('top') />
62
    </#if>
63
    <option value="${tmpListKey?html}"<#rt/>
64
        <#if (parameters.nameValue == tmpListKey)>
65
 selected="selected"<#rt/>
66
        </#if>
67
    ><#t/>
68
            ${tmpListValue?html}<#t/>
69
    </option><#lt/>
70
    </@s.iterator>
71
</select>
72
</#if>