Package org.openxava.annotations
Annotation Interface Tree
With
The full syntax for @Tree is @Tree(forViews="", notForViews="", pathProperty="path", idProperties="", idSeparator=",", initialExpandedState=true, orderIncrement=2, pathSeparator="/", allowMoveNodes=true).
@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)
@Tree // In versions previous to v7.5 use @Editor("TreeView") too
@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="/", allowMoveNodes=true).
- 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.
- allowMoveNodes. If false the user cannot move nodes in the tree. By default is true.
- Author:
- Federico Alcantara
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanIndicates whether the user can move nodes in the tree.List of comma separated view names where this annotation applies.Comma separated list of properties used for identifying the tree node.String to be used to separate multiple Id elements.booleanIndicates how to render the tree when the expandedPropertyName is not defined.List of comma separated view names where this annotation does not apply.intDeprecated.since OpenXava 7.2Property used for the path, must be a String type with a size appropriate to the task at hand.Defines the separator for the path elements.
-
Element Details
-
forViews
String forViewsList 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
String notForViewsList 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:
- ""
-
pathProperty
String pathPropertyProperty used for the path, must be a String type with a size appropriate to the task at hand. Optional. Defaults to path.- Returns:
- property name
- Default:
- "path"
-
idProperties
String idPropertiesComma 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. Optional.- Returns:
- node property name.
- Default:
- ""
-
idSeparator
String idSeparatorString to be used to separate multiple Id elements. Optional.- Default:
- ","
-
initialExpandedState
boolean initialExpandedStateIndicates how to render the tree when the expandedPropertyName is not defined. It's default value is true. Optional.- Returns:
- expanded state.
- Default:
- true
-
orderIncrement
Deprecated.since OpenXava 7.2Defines the increment used for the keys when orderBy is used The default value is 2. The minimum is 2. Optional.- Returns:
- order increment.
- Default:
- 2
-
pathSeparator
String pathSeparatorDefines the separator for the path elements. Default value is / Optional.- Returns:
- path separator character.
- Default:
- "/"
-
allowMoveNodes
boolean allowMoveNodesIndicates whether the user can move nodes in the tree. Default value is true (node movement is enabled). Optional.- Returns:
- allowMoveNodes state.
- Since:
- 7.5
- Default:
- true
-