Subversion Repositories Applications.papyrus

Rev

Rev 1318 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1318 Rev 1422
1
/*
1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
3
	All Rights Reserved.
4
 
4
 
5
	Licensed under the Academic Free License version 2.1 or above OR the
5
	Licensed under the Academic Free License version 2.1 or above OR the
6
	modified BSD license. For more information on Dojo licensing, see:
6
	modified BSD license. For more information on Dojo licensing, see:
7
 
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
9
*/
-
 
10
 
-
 
11
 
10
 
12
 
11
dojo.provide("dojo.widget.Select");
13
dojo.provide("dojo.widget.Select");
12
dojo.require("dojo.widget.ComboBox");
14
dojo.require("dojo.widget.ComboBox");
13
dojo.require("dojo.widget.*");
15
dojo.require("dojo.widget.*");
14
dojo.require("dojo.widget.html.stabile");
16
dojo.require("dojo.widget.html.stabile");
15
dojo.widget.defineWidget("dojo.widget.Select", dojo.widget.ComboBox, {forceValidOption:true, setValue:function (value) {
17
dojo.widget.defineWidget("dojo.widget.Select", dojo.widget.ComboBox, {forceValidOption:true, setValue:function (value) {
16
	this.comboBoxValue.value = value;
18
	this.comboBoxValue.value = value;
17
	dojo.widget.html.stabile.setState(this.widgetId, this.getState(), true);
19
	dojo.widget.html.stabile.setState(this.widgetId, this.getState(), true);
18
	this.onValueChanged(value);
20
	this.onValueChanged(value);
19
}, setLabel:function (value) {
21
}, setLabel:function (value) {
20
	this.comboBoxSelectionValue.value = value;
22
	this.comboBoxSelectionValue.value = value;
21
	if (this.textInputNode.value != value) {
23
	if (this.textInputNode.value != value) {
22
		this.textInputNode.value = value;
24
		this.textInputNode.value = value;
23
	}
25
	}
24
}, getLabel:function () {
26
}, getLabel:function () {
25
	return this.comboBoxSelectionValue.value;
27
	return this.comboBoxSelectionValue.value;
26
}, getState:function () {
28
}, getState:function () {
27
	return {value:this.getValue(), label:this.getLabel()};
29
	return {value:this.getValue(), label:this.getLabel()};
28
}, onKeyUp:function (evt) {
30
}, onKeyUp:function (evt) {
29
	this.setLabel(this.textInputNode.value);
31
	this.setLabel(this.textInputNode.value);
30
}, setState:function (state) {
32
}, setState:function (state) {
31
	this.setValue(state.value);
33
	this.setValue(state.value);
32
	this.setLabel(state.label);
34
	this.setLabel(state.label);
33
}, setAllValues:function (value1, value2) {
35
}, setAllValues:function (value1, value2) {
34
	this.setLabel(value1);
36
	this.setLabel(value1);
35
	this.setValue(value2);
37
	this.setValue(value2);
36
}});
38
}});
37
 
39