org.apache.cocoon.forms.datatype
Class EnumSelectionList
java.lang.Object
org.apache.cocoon.forms.datatype.EnumSelectionList
- All Implemented Interfaces:
- SelectionList
public class EnumSelectionList
- extends Object
- implements SelectionList
This type of selection list outputs a list of items
corresponding to the possible instances of an EnumType
.
Example usage:
<fd:selection-list type="enum" class="com.example.Sex"/>
Produces the following output:
<fi:selection-list>
<fi:item value=""/>
<fi:item value="com.example.Sex.MALE">
<fi:label>
<i18n:text>com.example.Sex.MALE</i18n:text>
</fi:label>
</fi:item>
<fi:item value="com.example.Sex.FEMALE">
<fi:label>
<i18n:text>com.example.Sex.FEMALE</i18n:text>
</fi:label>
</fi:item>
</fi:selection-list>
If you don't want an initial null value, add a
nullable="false"
attribute to the
fd:selection-list
element.
- Version:
- $Id: EnumSelectionList.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TEXT_EL
public static final String TEXT_EL
- See Also:
- Constant Field Values
EnumSelectionList
public EnumSelectionList(String className,
Datatype datatype,
boolean nullable)
throws ClassNotFoundException
- Parameters:
className
- datatype
-
- Throws:
ClassNotFoundException
EnumSelectionList
public EnumSelectionList(String className,
Datatype datatype,
boolean nullable,
String nullText)
throws ClassNotFoundException
- Throws:
ClassNotFoundException
getDatatype
public Datatype getDatatype()
- Specified by:
getDatatype
in interface SelectionList
generateSaxFragment
public void generateSaxFragment(ContentHandler contentHandler,
Locale locale)
throws SAXException
- Specified by:
generateSaxFragment
in interface SelectionList
- Throws:
SAXException
Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.