[jboss-cvs] jboss-seam/seam-gen/view ...
Gavin King
gavin.king at jboss.com
Sun Dec 3 22:06:04 EST 2006
User: gavin
Date: 06/12/03 22:06:04
Modified: seam-gen/view edit.xhtml.ftl view.xhtml.ftl
Log:
various improvements
Revision Changes Path
1.14 +136 -110 jboss-seam/seam-gen/view/edit.xhtml.ftl
(In the diff below, changes in quantity of whitespace are not shown.)
Index: edit.xhtml.ftl
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/seam-gen/view/edit.xhtml.ftl,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- edit.xhtml.ftl 4 Dec 2006 01:45:25 -0000 1.13
+++ edit.xhtml.ftl 4 Dec 2006 03:06:04 -0000 1.14
@@ -20,7 +20,7 @@
<h:messages globalOnly="true" styleClass="message"/>
- <h:form id="${componentName}">
+ <h:form id="${componentName}" styleClass="edit">
<div class="dialog">
<table>
@@ -92,8 +92,15 @@
</#if>
value="${'#'}{${homeName}.instance.${property.name}}"/>
<#elseif property.value.typeName == "string">
-<#if column.length gt 200>
+<#if column.length gt 160>
+<#if column.length gt 800>
+<#assign rows = 10>
+<#else>
+<#assign rows = (column.length/80)?int>
+</#if>
<h:inputTextarea id="${property.name}"
+ cols="80"
+ rows="${rows}"
<#if propertyIsId>
disabled="${'#'}{${homeName}.managed}"
</#if>
@@ -102,6 +109,11 @@
</#if>
value="${'#'}{${homeName}.instance.${property.name}}"/>
<#else>
+<#if column.length gt 100>
+<#assign size = 100>
+<#else>
+<#assign size = column.length>
+</#if>
<h:inputText id="${property.name}"
<#if propertyIsId>
disabled="${'#'}{${homeName}.managed}"
@@ -109,7 +121,7 @@
<#if !column.nullable>
required="true"
</#if>
- size="${column.length}"
+ size="${size}"
maxlength="${column.length}"
value="${'#'}{${homeName}.instance.${property.name}}"/>
</#if>
@@ -174,8 +186,13 @@
<#assign parentPageName = parentPojo.shortName>
<#assign parentName = util.lower(parentPojo.shortName)>
+ <div class="association" id="${property.name}">
+
<h2>${property.name}</h2>
- <h:outputText value="No ${property.name}" rendered="${'#'}{${homeName}.instance.${property.name} == null}"/>
+
+ <h:outputText value="No ${property.name}"
+ rendered="${'#'}{${homeName}.instance.${property.name} == null}"/>
+
<h:dataTable var="${parentName}"
value="${'#'}{${homeName}.instance.${property.name}}"
rendered="${'#'}{${homeName}.instance.${property.name} != null}"
@@ -207,17 +224,24 @@
</s:link>
</h:column>
</h:dataTable>
+
+ </div>
</#if>
<#if c2h.isOneToManyCollection(property)>
- <f:subview rendered="${'#'}{${homeName}.managed}">
+ <f:subview rendered="${'#'}{${homeName}.managed}" id="${property.name}">
+
+ <div class="association" id="${property.name}">
<h2>${property.name}</h2>
+
<#assign childPojo = c2j.getPOJOClass(property.value.element.associatedClass)>
<#assign childPageName = childPojo.shortName>
<#assign childEditPageName = childPojo.shortName + "Edit">
<#assign childName = util.lower(childPojo.shortName)>
- <h:outputText value="No ${property.name}" rendered="${'#'}{empty ${homeName}.${property.name}}"/>
+ <h:outputText value="No ${property.name}"
+ rendered="${'#'}{empty ${homeName}.${property.name}}"/>
+
<h:dataTable value="${'#'}{${homeName}.${property.name}}"
var="${childName}"
rendered="${'#'}{not empty ${homeName}.${property.name}}"
@@ -243,6 +267,8 @@
</h:column>
</h:dataTable>
+ </div>
+
<div class="actionButtons">
<s:button id="add${childName}"
value="Add ${childName}"
1.5 +96 -85 jboss-seam/seam-gen/view/view.xhtml.ftl
(In the diff below, changes in quantity of whitespace are not shown.)
Index: view.xhtml.ftl
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/seam-gen/view/view.xhtml.ftl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- view.xhtml.ftl 3 Dec 2006 09:02:26 -0000 1.4
+++ view.xhtml.ftl 4 Dec 2006 03:06:04 -0000 1.5
@@ -20,20 +20,15 @@
<h:messages globalOnly="true" styleClass="message"/>
- <h:form id="${componentName}">
- <div class="dialog">
+ <div id="${componentName}" class="dialog">
<table>
- <s:validateAll>
<#foreach property in pojo.allPropertiesIterator>
<#if !c2h.isCollection(property) && !c2h.isManyToOne(property)>
+<#if !property.equals(pojo.identifierProperty) || property.value.identifierGeneratorStrategy == "assigned">
+
<tr class="prop">
<td class="name">${property.name}</td>
- <td class="value">
-<#if property.equals(pojo.identifierProperty)>
-<#if property.value.identifierGeneratorStrategy == "assigned">
- ${'#'}{${homeName}.instance.${property.name}}
-</#if>
-<#else>
+ <td class="value" id="${property.name}">
<#if property.value.typeName == "date">
<h:outputText value="${'#'}{${homeName}.instance.${property.name}}">
<f:convertDateTime type="date" dateStyle="short"/>
@@ -57,21 +52,24 @@
<#else>
${'#'}{${homeName}.instance.${property.name}}
</#if>
-</#if>
</td>
</tr>
</#if>
+</#if>
</#foreach>
- </s:validateAll>
+
</table>
</div>
+
<div class="actionButtons">
+
<s:button id="edit" value="Edit"
view="/${editPageName}.xhtml"
propagation="begin">
<f:param name="${componentName}Id"
value="${'#'}{${homeName}.instance.${pojo.identifierProperty.name}}"/>
</s:button>
+
<s:button id="delete" value="Delete"
action="${'#'}{${homeName}.remove}"
rendered="${'#'}{${homeName}.managed}"
@@ -79,17 +77,21 @@
<f:param name="${componentName}Id"
value="${'#'}{${homeName}.instance.${pojo.identifierProperty.name}}"/>
</s:button>
- </div>
- </h:form>
+ </div>
<#foreach property in pojo.allPropertiesIterator>
-
<#if c2h.isManyToOne(property)>
<#assign parentPojo = c2j.getPOJOClass(cfg.getClassMapping(property.value.referencedEntityName))>
<#assign parentPageName = parentPojo.shortName>
<#assign parentName = util.lower(parentPojo.shortName)>
+
+ <div class="association" id="${property.name}">
+
<h2>${property.name}</h2>
- <h:outputText value="No ${property.name}" rendered="${'#'}{${homeName}.instance.${property.name} == null}"/>
+
+ <h:outputText value="No ${property.name}"
+ rendered="${'#'}{${homeName}.instance.${property.name} == null}"/>
+
<h:dataTable var="${parentName}"
value="${'#'}{${homeName}.instance.${property.name}}"
rendered="${'#'}{${homeName}.instance.${property.name} != null}"
@@ -117,16 +119,23 @@
</s:link>
</h:column>
</h:dataTable>
-</#if>
+ </div>
+</#if>
<#if c2h.isOneToManyCollection(property)>
+
+ <div class="association" id="${property.name}">
+
<h2>${property.name}</h2>
+
<#assign childPojo = c2j.getPOJOClass(property.value.element.associatedClass)>
<#assign childPageName = childPojo.shortName>
<#assign childEditPageName = childPojo.shortName + "Edit">
<#assign childName = util.lower(childPojo.shortName)>
<#assign childHomeName = childName + "Home">
- <h:outputText value="No ${property.name}" rendered="${'#'}{empty ${homeName}.${property.name}}"/>
+ <h:outputText value="No ${property.name}"
+ rendered="${'#'}{empty ${homeName}.${property.name}}"/>
+
<h:dataTable value="${'#'}{${homeName}.${property.name}}"
var="${childName}"
rendered="${'#'}{not empty ${homeName}.${property.name}}"
@@ -148,6 +157,8 @@
</h:column>
</h:dataTable>
+ </div>
+
<div class="actionButtons">
<s:button id="add${childName}" value="Add ${childName}"
view="/${childEditPageName}.xhtml" propagation="begin">
More information about the jboss-cvs-commits
mailing list