EasyView for JSF

Mogwai EasyView is a component library for Java Server Faces(JSF). It provides a generic mechanism to create complex user interfaces in a minimum amount of time. At the moment, only Facelets is supported as the View presentation layer.

Basically, a user interface is described using an expression. An expression is a list of properties combined with layout instructions. For every property, a label and an input component is generated. The label internationalisation is done using a provided ResourceBundle.

Example1:

property1,property2,property3 This example will layout the three properties in a row. So comma means "put the sequence of properties in a row".

Example2:

property1;property2;property3 This example will layout the three properties in three rows and one column. So it means "put the sequence of properties in a column".

Example3:

group1 [property1,property2,property3] This example will generate a group, and put the three properties inside the group in one row. So the [] indicates a group. The text before of the [ character is the caption of the group.

Example4:

{tab1 [property1, property2],tab2 [property3]} This example will generate a tabsheet, with two tabs. Here the grouping operator is used to define a tab.

Usage:

The installation is quite simple. Just place the EasyView .jar file in the WEB-INF/lib directory of your JSF application. Mogwai EasyView supports JBoss Richfaces and Apache MyFaces Tomahawk as the underlying component library. The configuration is done using a context parameter defined in web.xml the following way:

RichFaces:

<context-param>
<param-name>de.mogwai.easyview.factory</param-name>
<param-value>de.mogwai.easyview.factory.richfaces.RichfacesComponentFactory</param-value>
</context-param>

Tomahawk:

<context-param>
<param-name>de.mogwai.easyview.factory</param-name>
<param-value>de.mogwai.easyview.factory.tomahawk.TomahawkComponentFactory</param-value>
</context-param>

Example.xhtml

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:m="http://mogwai.sourceforge.net/easyview" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">
<head>
<title>test.xhtml</title>
<meta http-equiv="keywords" content="enter,your,keywords,here" />
<meta http-equiv="description" content="A short description of this page." />
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
</head>
<body>
<f:loadBundle var="bundle" basename="test"/>
<h:form>

<m:genericUI msg="#{bundle}" value="#{backingBean}"
uiExpression="exampleform [name1,name2;{tab1[name3,date,checkbox],tab2[text1;text2;text3]}]">
<m:property name="date" type="datepicker"/>
<m:property name="checkbox" type="checkbox"/>
</m:genericUI>

</h:form>
</body>
</html>

 

The component generation can be fine tuned using the m:property component. Here, a property is assigned to a stereotype. The stereotype defines the visual presentation of the property, e.g. a datepicker, a Checkbox or just an input field. The following stereotypes are supported:

  • text
  • password
  • textarea
  • checkbox
  • datepicker

Download latest release at SourceForge

Download


Project Homepage:
http://sourceforge.net/projects/mogwai

SourceForge.net Logo

Support This Project
Validate XHTML & CSS