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)typedescriptiondefault
columns (*)intnumber of grid columns
initialState (*)StringThe initial state of the grid and it´s widgets as a json string
idStringthe id of the grid
renderedbooleancontrols if the grid shall be renderedtrue
defaultStateStorecookie|server|nonedefines the default state store that stores the grid´s state, see herenone
stateStoreWidgetStateStoredefines an el expression to a custom state store implementation, see here
loadWidgetsByAjaxbooleancontrols, if the widget´s content is rendered by ajax (in parallel) on first time loadfalse
templateBaseUrlStringpath to the widget content facelets, could be multiple comma separated urlswidgetContent
layoutStringset a special layout of the grid (e.g. '3col01', '4col02', '5col01', ...)
layoutTemplateStringset a custom layout template as grid layout
sortablebooleancontrols, if widgets can be moved within the gridtrue
largeColumnsintdefines the columns to have doubled width compared to the normal ones
widthintdefines the grid weight in px100%
heightintdefines the grid height in px100%
styleClassStringlet´s you define an additionally style class for the grid´s outer div, see here
widgetStyleClassStringlet´s you define an additionally style class for the grid´s outer div, see here
closeIcon / editIcon / toggleIcon / reloadIcon / statusIcon / titleIconStringlet´s you define custom widget header icons
columnMarginfloatthe margin between the grid columns. Can be px or percent - depends on width is given.15px / 1.5%
columnWidthOffsetfloatvalue 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
roundedbooleanset the widget layout to rounded cornersfalse
opacityOnDragintset 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)typedescriptiondefault
title (*)Stringtitle of the widget
position (*)String (x-y)position of the widget in the grid
templateBaseUrlStringpath to the widget content facelets, could be multiple comma separated urlswidgetContent
templateIdStringthe 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)
collapsedbooleanindicates if the widget is collapsed or expandedfalse
commandClosebooleancontrols, if the widget has a close command icon in it´s headertrue
commandTogglebooleancontrols, if the widget has a toggle command icon in it´s headertrue
commandReloadbooleancontrols, if the widget has a reload command icon in it´s headertrue
commandEditbooleancontrols, if the widget has a edit command icon in it´s headertrue
showTitleIconbooleanif true, a the title icon will be shown in the widget´s headertrue
styleClassStringlet´s you define an additionally style class for the widget´s outer div
renderedbooleancontrols if the widget shall be renderedtrue
closeIcon / editIcon / toggleIcon / reloadIcon / statusIcon / titleIconStringlet´s you define custom widget header icons
roundedbooleanset the widget layout to rounded cornersfalse
sortablebooleancontrols, if the widget can be moved within the gridtrue
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)typedescriptiondefault
widgetGridId (*)Stringid of the widgetGrid to add the widget
widgetId (*)Stringid of the widget to add
value (*)Stringthe text value of the add widget link
initialStateStringThe 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>