Oracle Fusion Middleware Tag Reference for Oracle ADF Faces
11g Release 1 (



dataFlavor data flavor

The <af:dataFlavor> tag enables the page author to add an allowed to a drop target. The DataFlavor encapsulates a Java type that the drop target will accept as well as an additional discriminant on this Java type. DataFlavor discriminants allow page authors to set up drop targets that only accept drops from certain drag sources.

Multiple <af:dataFlavor> tags are allowed under a single drop target. A drop will be allowed if the drop contains any of the DataFlavors. The only valid parent tag of <af:dataFlavor> is <af:dropTarget> unless a component inherently accepts drops like the <af:panelDashboard> does, which would also make it a valid parent of the <af:dataFlavor> tag.


This example shows adding a DataFlavor on dropTarget to indicate drops of java.util.Collections.

              <af:outputText id="objectDropTarget" value="Fire these developers:">
                <af:dropTarget actions="COPY" dropListener="#{TestDropHandler.handleCollectionFireDrop}">
                  <af:dataFlavor flavorClass="java.util.Collection"/>

This example shows using the discriminant attribute. The source is a collectionDragSource with model=fileModel.

               <af:outputText id="genericDropTarget" value="Drop a row here!" >
                  <af:dropTarget actions="COPY" dropListener="#{demoDropHandler.handleDrop}">
                     <af:dataFlavor flavorClass="org.apache.myfaces.trinidad.model.RowKeySet" discriminant="fileModel"/>

This example shows a panelDashboard that accepts drops from outside of the panelDashboard into it.

              <af:panelDashboard id="dashboard" dimensionsFrom="auto" dropListener="#{demoDashboard.move}">
                <af:dataFlavor flavorClass="javax.faces.component.UIComponent"


Name Type Supports EL? Description
flavorClass String no

The fully qualified Java class name for this DataFlavor. If the drop contains this DataFlavor, the drop target is guaranteed to be able to retrieve an Object from the drop with this Java type using this DataFlavor.

While array types can be specified by appending square brackets to the type (java.lang.Object[]), the rich client marshalling code doesn't currently support array types other than Object[].

discriminant String no String discriminant used to further segregate the Java type system to prevent undesired drops from occurring. Take as an example, the case where there are two drag sources "A" and "B" that both produce employees and two drop targets "alpha" and "beta" that both consume employees. Assume the only legal drag combinations are A->alpha and B->beta. The page author can declaratively specify this by setting A to produce employees with the same DataFlavor discriminant that alpha accepts and B to produce employees with the same DataFlavor discriminant that beta accepts.