Main components
dynaWidgets contains different components. Here you see all components and their attributes or properties.
<dwComp:dynaWidgetGrid>
The dynaWidget grid component has some basic attributes that controls the main appearance of the grid.
| attribute (* required) | type | description | default |
| columns (*) | int | number of grid columns | |
| initialState (*) | String | The initial state of the grid and it´s widgets as a json string | |
| id | String | the id of the grid | |
| rendered | boolean | controls if the grid shall be rendered | true |
| defaultStateStore | cookie|server|none | defines the default state store that stores the grid´s state, see here | none |
| stateStore | WidgetStateStore | defines an el expression to a custom state store implementation, see here | |
| loadWidgetsByAjax | boolean | controls, if the widget´s content is rendered by ajax (in parallel) on first time load | false |
| templateBaseUrl | String | path to the widget content facelets, could be multiple comma separated urls | widgetContent |
| layout | String | set a special layout of the grid (e.g. '3col01', '4col02', '5col01', ...) | |
| layoutTemplate | String | set a custom layout template as grid layout | |
| sortable | boolean | controls, if widgets can be moved within the grid | true |
| largeColumns | int | defines the columns to have doubled width compared to the normal ones | |
| width | int | defines the grid weight in px | 100% |
| height | int | defines the grid height in px | 100% |
| styleClass | String | let´s you define an additionally style class for the grid´s outer div, see here | |
| widgetStyleClass | String | let´s you define an additionally style class for the grid´s outer div, see here | |
| closeIcon / editIcon / toggleIcon / reloadIcon / statusIcon / titleIcon | String | let´s you define custom widget header icons | |
| columnMargin | float | the margin between the grid columns. Can be px or percent - depends on width is given. | 15px / 1.5% |
| columnWidthOffset | float | value in px which will be substracted from each grid column´s width, to correct custom css configurations (e.g. border of gridColumn). Can be px or percent - depends on width is given. | 0 |
| rounded | boolean | set the widget layout to rounded corners | false |
| opacityOnDrag | int | set the opacity level of widgets while beeing dragged (0:full transparent, 1:no opacity) | 0.5 |
Independent of the attributes type, you can always use EL-Expressions as attribute value.
<dwComp:dynaWidget>
The dynaWidget component cannot be used as standalone, only in context of a dynaWidget grid - it´s properties are set by the initialState-String.
All of the following properties will be part of the widget´s state (if not set to default value).
| property (* required) | type | description | default |
| title (*) | String | title of the widget | |
| position (*) | String (x-y) | position of the widget in the grid | |
| templateBaseUrl | String | path to the widget content facelets, could be multiple comma separated urls | widgetContent |
| templateId | String | the id of the widget who´s content template to be used for this widget (allows to reuse the same 'widgetId_view.xhtml' for different widgets) | |
| collapsed | boolean | indicates if the widget is collapsed or expanded | false |
| commandClose | boolean | controls, if the widget has a close command icon in it´s header | true |
| commandToggle | boolean | controls, if the widget has a toggle command icon in it´s header | true |
| commandReload | boolean | controls, if the widget has a reload command icon in it´s header | true |
| commandEdit | boolean | controls, if the widget has a edit command icon in it´s header | true |
| showTitleIcon | boolean | if true, a the title icon will be shown in the widget´s header | true |
| styleClass | String | let´s you define an additionally style class for the widget´s outer div | |
| rendered | boolean | controls if the widget shall be rendered | true |
| closeIcon / editIcon / toggleIcon / reloadIcon / statusIcon / titleIcon | String | let´s you define custom widget header icons | |
| rounded | boolean | set the widget layout to rounded corners | false |
| sortable | boolean | controls, if the widget can be moved within the grid | true |
Independent of the property type, you can always use EL-Expressions as property value. But therefore you have to escape the expression with a backslash:
<dwComp:dynaWidgetGrid
...
initialState="
{
'myWidget':{'title':'My widget',rendered:'\#{elExp}',...},
...
}" />
<dwComp:addWidget>
Let´s you add widgets to a grid dynamically,
see here.
| attribute (* required) | type | description | default |
| widgetGridId (*) | String | id of the widgetGrid to add the widget | |
| widgetId (*) | String | id of the widget to add | |
| value (*) | String | the text value of the add widget link | |
| initialState | String | The initial state of the widget as a json string | |
<dwComp:resetWidgetGrid>
An actionListener for reset a widgetGrid to it´s initial state. It can be used with every JSF action component, e.g.
<h:commandLink...>
<dwComp:resetWidgetGrid widgetGridId="..." />
</h:commandLink>