Source Code Cross Referenced for Select.java in  » J2EE » webwork-2.2.6 » com » opensymphony » webwork » components » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » webwork 2.2.6 » com.opensymphony.webwork.components 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.opensymphony.webwork.components;
002:
003:        import com.opensymphony.xwork.util.OgnlValueStack;
004:
005:        import javax.servlet.http.HttpServletRequest;
006:        import javax.servlet.http.HttpServletResponse;
007:
008:        /**
009:         * <!-- START SNIPPET: javadoc -->
010:         * 
011:         * Render an HTML input tag of type select. 
012:         * 
013:         * <!-- END SNIPPET: javadoc -->
014:         *
015:         * <p/> <b>Examples</b>
016:         * <pre>
017:         * <!-- START SNIPPET: example -->
018:         * 
019:         * &lt;ww:select label="Pets"
020:         *        name="petIds"
021:         *        list="petDao.pets"
022:         *        listKey="id"
023:         *        listValue="name"
024:         *        multiple="true"
025:         *        size="3"
026:         *        required="true"
027:         * /&gt;
028:         *
029:         * &lt;ww:select label="Months"
030:         *        name="months"
031:         *        headerKey="-1" headerValue="Select Month"
032:         *        list="#{'01':'Jan', '02':'Feb', [...]}"
033:         *        value="selectedMonth"
034:         *        required="true"
035:         * /&gt;
036:         *
037:         * // The month id (01, 02, ...) returned by the getSelectedMonth() call
038:         * // against the stack will be auto-selected
039:         * 
040:         * <!-- END SNIPPET: example -->
041:         * </pre>
042:         * 
043:         * <p/>
044:         * 
045:         * <!-- START SNIPPET: exnote -->
046:         * 
047:         * Note: For any of the tags that use lists (select probably being the most ubiquitous), which uses the OGNL list
048:         * notation (see the "months" example above), it should be noted that the map key created (in the months example,
049:         * the '01', '02', etc.) is typed. '1' is a char, '01' is a String, "1" is a String. This is important since if
050:         * the value returned by your "value" attribute is NOT the same type as the key in the "list" attribute, they
051:         * WILL NOT MATCH, even though their String values may be equivalent. If they don't match, nothing in your list
052:         * will be auto-selected.<p/>
053:         * 
054:         * <!-- END SNIPPET: exnote -->
055:         *
056:         * @author Patrick Lightbody
057:         * @author Rene Gielen
058:         * @author tm_jee
059:         * @version $Revision: 2468 $
060:         * @since 2.2
061:         *
062:         * @ww.tag name="select" tld-body-content="JSP" tld-tag-class="com.opensymphony.webwork.views.jsp.ui.SelectTag"
063:         * description="Render a select element"
064:         */
065:        public class Select extends ListUIBean {
066:            final public static String TEMPLATE = "select";
067:
068:            protected String emptyOption;
069:            protected String headerKey;
070:            protected String headerValue;
071:            protected String multiple;
072:            protected String size;
073:
074:            public Select(OgnlValueStack stack, HttpServletRequest request,
075:                    HttpServletResponse response) {
076:                super (stack, request, response);
077:            }
078:
079:            protected String getDefaultTemplate() {
080:                return TEMPLATE;
081:            }
082:
083:            public void evaluateExtraParams() {
084:                super .evaluateExtraParams();
085:
086:                if (emptyOption != null) {
087:                    addParameter("emptyOption", findValue(emptyOption,
088:                            Boolean.class));
089:                }
090:
091:                if (multiple != null) {
092:                    addParameter("multiple", findValue(multiple, Boolean.class));
093:                }
094:
095:                if (size != null) {
096:                    addParameter("size", findString(size));
097:                }
098:
099:                if ((headerKey != null) && (headerValue != null)) {
100:                    addParameter("headerKey", findString(headerKey));
101:                    addParameter("headerValue", findString(headerValue));
102:                }
103:            }
104:
105:            /**
106:             * Whether or not to add an empty (--) option after the header option
107:             * @ww.tagattribute required="false" type="Boolean" default="false"
108:             */
109:            public void setEmptyOption(String emptyOption) {
110:                this .emptyOption = emptyOption;
111:            }
112:
113:            /**
114:             * Key for first item in list. Must not be empty! "'-1'" and "''" is correct, "" is bad.
115:             * @ww.tagattribute required="false"
116:             */
117:            public void setHeaderKey(String headerKey) {
118:                this .headerKey = headerKey;
119:            }
120:
121:            /**
122:             * Value expression for first item in list
123:             * @ww.tagattribute required="false"
124:             */
125:            public void setHeaderValue(String headerValue) {
126:                this .headerValue = headerValue;
127:            }
128:
129:            /**
130:             * Creates a multiple select. The tag will pre-select multiple values if the values are passed as an Array (of appropriate types) via the value attribute. Passing a Collection may work too? Haven't tested this.
131:             * @ww.tagattribute required="false"  type="Boolean" default="false"
132:             */
133:            public void setMultiple(String multiple) {
134:                this .multiple = multiple;
135:            }
136:
137:            /**
138:             * Size of the element box (# of elements to show)
139:             * @ww.tagattribute required="false" type="Integer"
140:             */
141:            public void setSize(String size) {
142:                this.size = size;
143:            }
144:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.