OW2 Consortium telosys

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
13 lguerin 1
//----------------------------------------------------------------------------------------------------
2
function fwkComboDisplayList(id)
3
{
4
	if ( id != null )
5
	{
6
		//alert("fwkComboDisplayList(" + id + ")");
7
		var comboDiv = document.getElementById(id+"_main");
8
		var comboInput = document.getElementById(id);
9
		var comboPicto = document.getElementById(id+"_picto");
10
		var comboSelect = document.getElementById(id+"_select");
11
		if(comboDiv != null && comboSelect!=null)
12
		{
13
			//alert("fwkComboDisplayList(" + id + ") Step 2 ");
14
			//var pos = fwkGetXY(comboDiv);
15
			var pos = fwkGetRelativeXY(comboDiv);
16
			if ( pos != null )
17
			{
18
				//alert("fwkComboDisplayList(" + id + ") Step 3 ");
19
				comboSelect.style.left = pos[0] ; // X
20
				comboSelect.style.top = pos[1] + comboDiv.offsetHeight + 1 ; // Y
21
				comboSelect.style.width = comboInput.offsetWidth + comboPicto.offsetWidth;
22
				comboSelect.style.display="block";
23
				comboSelect.focus();
24
			}
25
		}
26
	}
27
	else
28
	{
29
		fwkError("fwkComboDisplayList : ID argument is null !");
30
	}
31
}
32
 
33
//----------------------------------------------------------------------------------------------------
34
function fwkComboHideList(id)
35
{
36
	if ( id != null )
37
	{
38
		var comboSelect = document.getElementById(id+"_select");
39
		if(comboSelect != null)
40
		{
41
			comboSelect.selectedIndex=-1;
42
			comboSelect.style.display="none";
43
		}
44
		else
45
		{
46
			fwkError("fwkComboHideList : No element for id '" + id + "' ");
47
		}
48
	}
49
	else
50
	{
51
		fwkError("fwkComboHideList : ID argument is null !");
52
	}
53
}
54
 
55
//----------------------------------------------------------------------------------------------------
56
function fwkComboSelectBlur(id)
57
{
58
	fwkComboHideList(id)
59
}
60
 
61
//----------------------------------------------------------------------------------------------------
62
function fwkComboSelectChange(select,id)
63
{
64
	if ( id != null )
65
	{
66
		var comboInput = document.getElementById(id);
67
		if(comboInput != null)
68
		{
69
			comboInput.value = select.options[select.selectedIndex].text;
70
			comboInput.focus();
71
		}
72
		else
73
		{
74
			fwkError("fwkComboSelectChange : No element for id '" + id + "' ");
75
		}
76
	}
77
	else
78
	{
79
		fwkError("fwkComboSelectChange : ID argument is null !");
80
	}
81
}