org.apache.cocoon.forms.datatype
Class JavaScriptSelectionListBuilder
java.lang.Object
org.apache.cocoon.forms.datatype.JavaScriptSelectionListBuilder
- All Implemented Interfaces:
- Contextualizable, SelectionListBuilder
- public class JavaScriptSelectionListBuilder
- extends Object
- implements SelectionListBuilder, Contextualizable
Builds a selection list that will take its values from a JavaScript snippet.
The snippet runs in scope where the list filter (if any) and the view data are
available as filter and viewData respectively, along
with all flowscript functions. It must return a list of (value, label) pairs.
If an item has no label, its value is used as the label. If the declaration has
a catalogue attribute, the labels are interpreted as i18n keys in
that catalogue.
Example:
<fd:selection-list type="flow-function">
return [ {value: 3, label: "three"}, {value:4} ];
</fd:selection-list>
- Since:
- 2.1.9
- Version:
- $Id: JavaScriptSelectionListBuilder.java 449149 2006-09-23 03:58:05Z crossley $
- See Also:
JavaScriptSelectionList
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JavaScriptSelectionListBuilder
public JavaScriptSelectionListBuilder()
contextualize
public void contextualize(Context context)
throws ContextException
- Specified by:
contextualize in interface Contextualizable
- Throws:
ContextException
build
public SelectionList build(Element selectionListElement,
Datatype datatype)
throws Exception
- Specified by:
build in interface SelectionListBuilder
- Throws:
Exception
Copyright © 1999-2007 The Apache Software Foundation. All Rights Reserved.