Tags collection - collectionItem - collectionInput - collectionStyle - pager - pagerStatus - swap - nestedCollection - nestedTreeCollection - collectionDetail - collectionTitle - collectionGroup
Iterate over a java.util.Collection and display the selected properties of each bean in the collection
| Attribute Name | Description |
|---|---|
| bundle | Bundle to use to display the messages |
| name | Name of the first collection in the pageContext or name of the bean containing the collection. Default: the form bean name |
| property | Property of the bean 'name' giving the first collection [EL] |
| id | Id to expose the bean in the collection during the iteration process. |
| model | Name of the model to use to render the collection. See the skin page for more information |
| name2 | Name of the second collection in the pageContext or name of the bean containing the collection. |
| property2 | Property of the bean 'name' giving the second collection |
| id2 | Id to expose the bean in the second collection during the iteration process. |
| indexId | The name of the bean that will contain the index of the current bean in the collection during an iteration. |
| oddId | If this attribute is set, put a boolean in the pageContext indicating if the index is odd or not. |
| sortPictogram | The name of the image that will be used to display the links to sort the collection |
| sortLabel | The alt text of the image that will be used to display the links to sort the collection |
| sortAction, sortParam | used to set a custom sort action with specified url and parameter. Sort the collection on the client with javascript if set to "client" |
| styleClass | css class to use to display the collection |
| styleClass2 | When set, styleClass and styleClass2 are swapped after each iteration to allow row color alternance. |
| styleId | Identifier to be assigned to the HTML generated table element. |
| selectId | Property holding the id of the bean. Used with multiple selection when the form bean property is a Map. |
| selectIndex | Nested form bean property. Used whith multiple selection when the form bean property is an Array. |
| selectName | name of the form bean property to use to send back which bean of the collection is selected. If null, selectProperty value is used. |
| selectProperty | Property of the beans to use to specify which bean is selected |
| selectType | Specify if it is possible to select a single value (radio) or multiple values (checkbox) |
| width | Width of the panel used to render the collection |
| align | Alignment of the panel. Default is CENTER |
| offset | Offset of the index of the collection to start with |
| length | Index of the last item in the collection to display |
| offsetIndexId | Name of the bean that will contain the iteration index, starting at the offset value |
| onRowClick | Javascript code to execute when a row is clicked on [EL] |
| onRowDblClick | Javascript code to execute when a row is doubleclicked on [EL] |
| onRowMouseOut | Javascript code to execute when the mouse moves out of a row [EL] |
| onRowMouseOver | Javascript code to execute when the mouse moves over a row [EL] |
The collectionItem tag is used to specify the properties of a bean that must be displayed in a collection tag.
| Attribute Name | Description |
|---|---|
| action | Struts action to use to compute the URL |
| arg0, arg1 | Optional title parametric replacement values [EL ] |
| filter | If set to false, do not filter sensitive HTML characters |
| forward | As url, but the url is computed with the specified struts forward. |
| footer | Footer of the column [EL] |
| footerArg0, footerArg1 | Optional title parametric replacement values [EL] |
| href | As href |
| mathOperation | Math operation to apply to the column. Valid values are : geometricMean, max, mean, min, product, sum, sumLog, sumSq, variance |
| mathPattern | DecimalFormat pattern to use to format the numbers |
| name | Name of the bean containing the property to display. By default, the beans on the first collection are used. |
| onclick | The value of this attribute is copied to the onclick attribute of the generated hyperlink [EL] |
| page | As url, but the url is computed with the specifed page. |
| param | If specified, the value of the property named 'param' will be appends to the previous url. |
| paramId | Comma separated list of parameter ids to add to the previous url. |
| paramName | Comma separated list of parameter names to add to the previous url. This attribute is not required (the current bean from the collection is used by default). |
| paramProperty | Comma separated list of parameter properties to use to generate the parameters for the previous url. |
| property | Name of the property to of the beans to display |
| sortable | If set to true, display a link to sort the collection by this column. The configuration of the sort action is described in the example section. |
| style | Override the style class defined in the collection tag with the specified style. The style should end with ';' |
| styleClass | Override the style class defined in the collection tag. Not compatible with the collectionStyle tag and the use of 2 styleClasses in the collection tag |
| target | target frame |
| title | Key of the title to display for this property [EL] |
| type | Format type [EL] |
| url | If specified, the property value will be rendered with an html link to this url. |
| width | Column width |
The collectionInput tag goals is to allow to edit the specified property of the beans in the current collection.
| Attribute Name | Description |
|---|---|
| createFormatter | struts-layout formatter to apply on the displayed value in create mode |
| editFormatter | struts-layout formatter to apply on the displayed value in edit mode [EL] |
| formIndex | name of the index variable in the pageContext. If null the current index is used. |
| formName | name of the form to use to send the values |
| formProperty | indexed property of the form to use to send the values [EL] |
| inspectFormatter | struts-layout formatter to apply on the displayed value in inspect mode |
| keyProperty | If set, the form property must be a mapped property. The key used are the keyProperty of the beans |
| maxlength | Maxlength of the generated input fields |
| mode | Display mode of the input fields. See the documentation of the input fields |
| name | Name of the bean containing the property to display. By default, the beans on the first collection are used. |
| onchange | onchange javascript handler [EL] |
| policy | struts-layout policy to use to restrict the display mode |
| property | Name of the property of the beans to display |
| size | Size of the generated input fields |
| sortable | If set to true, display a link to sort the collection bu this column. The configuration of the sort action is described in the example section. |
| title | Key of the title to display for this property |
| tooltip | Key of the tooltip to display for this property [EL] |
| useCollectionSelection | If true, edit or inspect mode is choosen in function of the collection selected rows. |
| width | Width of the generated input fiels |
The collectionStyle tag changes the styleClass of the rows matching a specified condition.
If the matchStyle and nonMatchStyle attributes are used, it is possible to nest several collectionStyle tags, and use them with row color alternance.
| Attribute Name | Description |
|---|---|
| name | Name of the bean containing the property to test. |
| property | Name of the property to test |
| value | If set, value the specified bean property must match |
| valueName | Name of the bean containing the match value |
| valueProperty | The match value property name |
| lessThan | If set, value the specified bean property must be less than. |
| greaterThan | If set, value the specified bean property must be greater than. |
| matchStyleClass | styleClass to use if the condition is meet |
| nonMatchStyleClass | styleClass to use if the condition is not meet (optionnal) |
| matchStyle | style to use if the condition is meet. The style must end with ';'. |
| nonMatchStyle | style to use if the condition is not meet (optionnal). The style must end with '.' |
the pager limits the number of items printed at a time
The pager tag can be use to display a collection on several pages when there is a large number of items in the collection. The <layout:collection> tag must be nested in the <layout:pager> tag, and the sort action must be configured for the pager tag to work.
The pager uses the following keys in the skin properties file
| Attribute Name | Description |
|---|---|
| linksLocation | Location of the pager links. Allowed values are "top", "bottom" (default) and "both" |
| maxPageItems | Max number of items per page (a default value can be set in the skin configuration file) [EL] |
| sessionPagerId | Name of the session attribute that holds the number of the initial page to display (the attribute must be a String). When the user navigates in the pages, the attribute is updated automatically. If this attribute is not set, the first page is displayed initially. |
| styleClass | style class of the pager links |
| width | Width of the pager links cell |
pagerStatus - display the status of the pager
The pagerStatus tag displays additional information on the pager status. It must be nested in a pager tag and put after the collection tag.
The following parameters can be inserted into the message:
The default message is {0}/{1}.
swap : Move rows between two tables
The swap tag includes the javascript code and display the buttons that are required to move rows between two tables. An hidden select box is automatically updated so that it is possible to know which rows have been swapped
nestedCollection : Iterate over nested collection
The nestedCollection tag allows to iterate over nested collection. For example, it can display the list of cars of a list of user. nestedCollection is not compatible with Javascript sort. Server side sort allows to sort the main columns.
| Attribute Name | Description |
|---|---|
| name | name of the bean holding the nested collection. Default is the current bean |
| property | property of the bean giving the nested collection |
| id | Id to expose the bean in the collection during the iteration process. |
| indexId | indexId to expose the bean in the collection during the iteration process. |
Tag allowing nested collection display
Same behavior as the nestedCollection tag with a tree displat
| Attribute Name | Description |
|---|---|
| name | name of the bean holding the nested collection. Default is the current bean |
| property | property of the bean giving the nested collection |
| id | Id to expose the bean in the collection during the iteration process. |
| indexId | indexId to expose the bean in the collection during the iteration process. |
| labelProperty | Property to display as node value. |
collectionDetail : Defines a property to be displayed as a detail.
The collectionDetail tag allows to specify the properties that will be displayed as details.
Detail properties are not displayed in a column, but in a text field under the collection.
When the user moves the mouse over a row, the detail fields are updated with the data of the selected row.
The <layout:detail> tag must be used to specify where the detail must be displayed.
The id and indexId attributes of the collection tag must be set.
collectionTitle : Defines a title for several columns
The collectionTitle tag allows to span a title for several columns, and to create different title lines
A title defines with a collectionTitle tag applies to the columns nested into the collectionTitle tag. A collectionTitle tag can contain other collectionTitle tag, or collectionItem and collectionInput tags.