-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbtn.jsf
executable file
·46 lines (39 loc) · 2.16 KB
/
btn.jsf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
function setDefaultValues() {
var values = new Array();
values.push({ name:"State", type:"ComboBox", value:"Normal,Normal,Over,Press,Disabled"});
values.push({ name:"Type", type:"ComboBox", value:"Empty,Empty,First,First disabled,Previous,Previous disabled,Refresh,Next,Next disabled,Last,Last disabled"});
Widget.elem.customData["currentValues"] = values;
}
function applyCurrentValues() {
var values = Widget.elem.customData["currentValues"];
var state = values[0].value.split(",")[0];
Widget.GetObjectByName("normal").visible = (state=="Normal");
Widget.GetObjectByName("over").visible = (state=="Over");
Widget.GetObjectByName("press").visible = (state=="Press");
Widget.GetObjectByName("disabled").visible = (state=="Disabled");
var type = values[1].value.split(",")[0];
Widget.GetObjectByName("first").visible = (type=="First");
Widget.GetObjectByName("first-disabled").visible = (type=="First disabled");
Widget.GetObjectByName("previous").visible = (type=="Previous");
Widget.GetObjectByName("previous-disabled").visible = (type=="Previous disabled");
Widget.GetObjectByName("refresh").visible = (type=="Refresh");
Widget.GetObjectByName("next").visible = (type=="Next");
Widget.GetObjectByName("next-disabled").visible = (type=="Next disabled");
Widget.GetObjectByName("last").visible = (type=="Last");
Widget.GetObjectByName("last-disabled").visible = (type=="Last disabled");
if (type=="Empty") {
Widget.GetObjectByName("first").visible = false;
Widget.GetObjectByName("first-disabled").visible = false;
Widget.GetObjectByName("previous").visible = false;
Widget.GetObjectByName("previous-disabled").visible = false;
Widget.GetObjectByName("refresh").visible = false;
Widget.GetObjectByName("next").visible = false;
Widget.GetObjectByName("next-disabled").visible = false;
Widget.GetObjectByName("last").visible = false;
Widget.GetObjectByName("last-disabled").visible = false;
}
}
switch (Widget.opCode) {
case 1: setDefaultValues(); break;
case 2: applyCurrentValues(); break;
}