Package org.openxava.annotations
Annotation Type Tree
-
@Repeatable(Trees.class) @Retention(RUNTIME) @Target({FIELD,METHOD}) public @interface Tree
With@Tree
you can instruct OpenXava to visualize collections as a tree instead of a list.Applies to @OneToMany/@ManyToMany collections. Example:
@OneToMany(mappedBy="parentContainer", cascade = CascadeType.REMOVE) @Editor("TreeView") @ListProperties("description") @OrderBy("path, treeOrder") private Collection
treeItems;
The full syntax for @Tree is @Tree(forViews="", notForViews="", pathProperty="path", idProperties="", idSeparator=",", initialExpandedState=true, orderIncrement=2, pathSeparator="/").- forViews. Indicates in which views the tree behavior is going to be applied.
- notForViews. Views which are excluded from the tree renderization.
- pathProperty. Indicates the property to be used as the path, by default points to "path". You can customize this property if the entity path reference is persisted in a property with another name.
- idProperties. The tree implementation needs a unique identification for each of the elements displayed. By default the tree implementation use the properties annotated with @Id, but you can define which properties the tree must use as the unique identifier. The defined properties are comma separated.
- initialExpandedState. If true the tree is rendered with all nodes expanded.
- orderIncrement. If you define a orderBy and the orderBy is an integer type, the Tree implementation uses this field to allow reordering of the tree elements, by default the increment value is 2 and is the minimum allowed. This value allow easy reordering of elements.
- pathSeparator. If you use a separator for your path different than the default "/". Then you can set this property to the value that you are using.
- Author:
- Federico Alcantara
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.String
forViews
List of comma separated view names where this annotation applies.java.lang.String
idProperties
Optional.java.lang.String
idSeparator
Optional.boolean
initialExpandedState
Optional.java.lang.String
notForViews
List of comma separated view names where this annotation does not apply.int
orderIncrement
Deprecated.since OpenXava 7.2 Optional.java.lang.String
pathProperty
Optional.java.lang.String
pathSeparator
Optional.
-
-
-
Element Detail
-
forViews
java.lang.String forViews
List of comma separated view names where this annotation applies.Exclusive with notForViews.
If both forViews and notForViews are omitted then this annotation apply to all views.
You can use the string "DEFAULT" for referencing to the default view (the view with no name).- Default:
- ""
-
-
-
notForViews
java.lang.String notForViews
List of comma separated view names where this annotation does not apply.Exclusive with forViews.
If both forViews and notForViews are omitted then this annotation apply to all views.
You can use the string "DEFAULT" for referencing to the default view (the view with no name).- Default:
- ""
-
-
-
idProperties
java.lang.String idProperties
Optional. Comma separated list of properties used for identifying the tree node. By default the id of the entity is used. If more than one property is used, their values will be nodeIdSeparator separated and enclosed in brackets.- Returns:
- node property name.
- Default:
- ""
-
-