Subversion Repositories Applications.papyrus

Rev

Rev 1371 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1318 alexandre_ 1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
4
 
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:
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
10
 
11
dojo.provide("dojo.widget.Select");
12
dojo.require("dojo.widget.ComboBox");
13
dojo.require("dojo.widget.*");
14
dojo.require("dojo.widget.html.stabile");
15
dojo.widget.defineWidget("dojo.widget.Select", dojo.widget.ComboBox, {forceValidOption:true, setValue:function (value) {
16
	this.comboBoxValue.value = value;
17
	dojo.widget.html.stabile.setState(this.widgetId, this.getState(), true);
18
	this.onValueChanged(value);
19
}, setLabel:function (value) {
20
	this.comboBoxSelectionValue.value = value;
21
	if (this.textInputNode.value != value) {
22
		this.textInputNode.value = value;
23
	}
24
}, getLabel:function () {
25
	return this.comboBoxSelectionValue.value;
26
}, getState:function () {
27
	return {value:this.getValue(), label:this.getLabel()};
28
}, onKeyUp:function (evt) {
29
	this.setLabel(this.textInputNode.value);
30
}, setState:function (state) {
31
	this.setValue(state.value);
32
	this.setLabel(state.label);
33
}, setAllValues:function (value1, value2) {
34
	this.setLabel(value1);
35
	this.setValue(value2);
36
}});
37