Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cocoon.forms.datatype
Class JavaScriptSelectionListBuilder

    java.lang.Object
      org.apache.cocoon.forms.datatype.JavaScriptSelectionListBuilder

All Implemented Interfaces:
  SelectionListBuilder

public class JavaScriptSelectionListBuilder
extends Object
implements SelectionListBuilder

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 587759 2007-10-24 03:00:37Z vgritsenko $
See Also:
  `JavaScriptSelectionList`

Field Summary

Fields inherited from interface org.apache.cocoon.forms.datatype.SelectionListBuilder
`ROLE`

Constructor Summary
`JavaScriptSelectionListBuilder()`

Method Summary
`SelectionList` | `build(Element selectionListElement, Datatype datatype)`
`void` | `setProcessInfoProvider(org.apache.cocoon.processing.ProcessInfoProvider processInfoProvider)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### JavaScriptSelectionListBuilder

    public JavaScriptSelectionListBuilder()

Method Detail

### build

    public SelectionList build(Element selectionListElement,
                               Datatype datatype)
                        throws Exception

  Specified by:
    `build` in interface `SelectionListBuilder`
  Throws:
    `Exception`

### setProcessInfoProvider

    public void setProcessInfoProvider(org.apache.cocoon.processing.ProcessInfoProvider processInfoProvider)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1999-2008 The Apache Software Foundation. All Rights Reserved.