My first dynaWidget grid

This is a dynaWidget


A dynaWidget is made up of:

This is a dynaWidget grid

What you can see here are four widgets within a two column grid. You can move around the widgets, collapse or expand them, reload the content as well as close them. Just play around with it!
My first widget
This is the content of my first widget! There´s not much behind it, just a simple facelets page with text.
My second widget
This is the content of my second widget! This one is very similar to the first widget and is only containing some text.
My fourth widget
This is the content of my fourth widget! Well, it´s the same like the first and second widget - just to fill this up a little bit...
My third widget
This widget is a little bit more complex - we have an image inside and we have an edit content (click on the second header-icon!)

A dynaWidget grid is made up of:

Defining this dynaWidget grid in 3 steps

Now you see how to implement this widget grid with two columns containing the four simple widgets.

1.) Before using the dynaWidget components you must declare the following xml namespace prefixes

	  		<html
	 			xmlns:dwFct="http://www.solseit.de/jsf/fct/dynaWidget"
	 			xmlns:dwComp="http://www.solseit.de/jsf/comp/dynaWidget">
	 			...
	 		</html>  
      	

2.) Define a dynaWidget grid component with four widgets: 'firstWidget', 'secondWidget', 'thirdWidget' and ... 'fourthWidget'

			<dwComp:dynaWidgetGrid id="myGrid" columns="2" 
				templateBaseUrl="widgetContent" width="500"
				initialState="
					{
					'firstWidget':
					{
						'title':'My first widget','position':'1-1','commandEdit':'false'
					},						
					'secondWidget':
					{
						'title':'My second widget','position':'1-2','commandEdit':'false'
					},						
					'thirdWidget':
					{
						'title':'My third widget','position':'2-1'
					},
					'fourthWidget':
					{
						'title':'My fourth widget','position':'1-3','commandEdit':'false'
					}					
				}" />
      	
What´s important here:

3.) Create the widget content facelets (place it into templateBaseUrl folder widgetContent).

A content facelet is a file with the name widgetId_view.xhtml and looks like this:
			"widgetContent/firstWidget_view.xhtml"
			
			<ui:composition  
				xmlns:ui="http://java.sun.com/jsf/facelets"	
				xmlns:h="http://java.sun.com/jsf/html">
			
				<h:outputText value="This is the content of my first widget! There´s not much behind it, just a simple facelets page with text." />
								
			</ui:composition>
		
What´s important here: For details on using the dynaWidget components see main components.