01: package org.wings.plaf.css.script;
02:
03: import org.wings.script.ScriptListener;
04: import org.wings.util.SStringBuilder;
05:
06: public class HideSelectBoxesScript implements ScriptListener {
07:
08: public String getEvent() {
09: return null;
10: }
11:
12: public String getCode() {
13: return null;
14: }
15:
16: public String getScript() {
17: final SStringBuilder script = new SStringBuilder();
18: script.append("function hideSelectBoxes() {\n");
19: script
20: .append(" for (var i = 0; i < document.forms.length; i++) {\n");
21: script
22: .append(" for (var e = 0; e < document.forms[i].length; e++) {\n");
23: script
24: .append(" if (document.forms[i].elements[e].tagName == 'SELECT') {\n");
25: script
26: .append(" document.forms[i].elements[e].style.visibility = 'hidden';\n");
27: script.append(" }\n");
28: script.append(" }\n");
29: script.append(" }\n");
30: script.append("}\n");
31: script.append("hideSelectBoxes();\n");
32: return script.toString();
33: }
34:
35: public int getPriority() {
36: return 0;
37: }
38: }
|