Index: trunk/grails-app/views/assetSubItem/edit.gsp
===================================================================
--- trunk/grails-app/views/assetSubItem/edit.gsp	(revision 267)
+++ trunk/grails-app/views/assetSubItem/edit.gsp	(revision 268)
@@ -5,24 +5,24 @@
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
         <meta name="layout" content="main" />
-        <title>Edit AssetType</title>
+        <title>Edit AssetSubItem</title>
     </head>
     <body>
         <div class="nav">
-            <span class="menuButton"><g:link class="list" action="list">AssetType List</g:link></span>
-            <span class="menuButton"><g:link class="create" action="create">New AssetType</g:link></span>
+            <span class="menuButton"><g:link class="list" action="list">AssetSubItem List</g:link></span>
+            <span class="menuButton"><g:link class="create" action="create">New AssetSubItem</g:link></span>
         </div>
         <div class="body">
-            <h1>Edit AssetType</h1>
+            <h1>Edit AssetSubItem</h1>
             <g:if test="${flash.message}">
             <div class="message">${flash.message}</div>
             </g:if>
-            <g:hasErrors bean="${assetTypeInstance}">
+            <g:hasErrors bean="${assetSubItemInstance}">
             <div class="errors">
-                <g:renderErrors bean="${assetTypeInstance}" as="list" />
+                <g:renderErrors bean="${assetSubItemInstance}" as="list" />
             </div>
             </g:hasErrors>
             <g:form method="post" >
-                <input type="hidden" name="id" value="${assetTypeInstance?.id}" />
-                <input type="hidden" name="version" value="${assetTypeInstance?.version}" />
+                <input type="hidden" name="id" value="${assetSubItemInstance?.id}" />
+                <input type="hidden" name="version" value="${assetSubItemInstance?.version}" />
                 <div class="dialog">
                     <table>
@@ -31,40 +31,8 @@
                             <tr class="prop">
                                 <td valign="top" class="name">
-                                    <label for="assemblies">Assemblies:</label>
+                                    <label for="name">Name:</label>
                                 </td>
-                                <td valign="top" class="value ${hasErrors(bean:assetTypeInstance,field:'assemblies','errors')}">
-                                    
-<ul>
-<g:each var="a" in="${assetTypeInstance?.assemblies?}">
-    <li><g:link controller="assembly" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
-</g:each>
-</ul>
-<g:link controller="assembly" params="['assetType.id':assetTypeInstance?.id]" action="create">Add Assembly</g:link>
-
-                                </td>
-                            </tr> 
-                        
-                            <tr class="prop">
-                                <td valign="top" class="name">
-                                    <label for="assets">Assets:</label>
-                                </td>
-                                <td valign="top" class="value ${hasErrors(bean:assetTypeInstance,field:'assets','errors')}">
-                                    
-<ul>
-<g:each var="a" in="${assetTypeInstance?.assets?}">
-    <li><g:link controller="asset" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
-</g:each>
-</ul>
-<g:link controller="asset" params="['assetType.id':assetTypeInstance?.id]" action="create">Add Asset</g:link>
-
-                                </td>
-                            </tr> 
-                        
-                            <tr class="prop">
-                                <td valign="top" class="name">
-                                    <label for="costCode">Cost Code:</label>
-                                </td>
-                                <td valign="top" class="value ${hasErrors(bean:assetTypeInstance,field:'costCode','errors')}">
-                                    <input type="text" id="costCode" name="costCode" value="${fieldValue(bean:assetTypeInstance,field:'costCode')}"/>
+                                <td valign="top" class="value ${hasErrors(bean:assetSubItemInstance,field:'name','errors')}">
+                                    <input type="text" maxlength="50" id="name" name="name" value="${fieldValue(bean:assetSubItemInstance,field:'name')}"/>
                                 </td>
                             </tr> 
@@ -74,6 +42,6 @@
                                     <label for="description">Description:</label>
                                 </td>
-                                <td valign="top" class="value ${hasErrors(bean:assetTypeInstance,field:'description','errors')}">
-                                    <input type="text" id="description" name="description" value="${fieldValue(bean:assetTypeInstance,field:'description')}"/>
+                                <td valign="top" class="value ${hasErrors(bean:assetSubItemInstance,field:'description','errors')}">
+                                    <input type="text" maxlength="100" id="description" name="description" value="${fieldValue(bean:assetSubItemInstance,field:'description')}"/>
                                 </td>
                             </tr> 
@@ -83,6 +51,40 @@
                                     <label for="isActive">Is Active:</label>
                                 </td>
-                                <td valign="top" class="value ${hasErrors(bean:assetTypeInstance,field:'isActive','errors')}">
-                                    <g:checkBox name="isActive" value="${assetTypeInstance?.isActive}" ></g:checkBox>
+                                <td valign="top" class="value ${hasErrors(bean:assetSubItemInstance,field:'isActive','errors')}">
+                                    <g:checkBox name="isActive" value="${assetSubItemInstance?.isActive}" ></g:checkBox>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="asset">Asset:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:assetSubItemInstance,field:'asset','errors')}">
+                                    <g:select optionKey="id" from="${Asset.list()}" name="asset.id" value="${assetSubItemInstance?.asset?.id}" noSelection="['null':'']"></g:select>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="parentItem">Parent Item:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:assetSubItemInstance,field:'parentItem','errors')}">
+                                    <g:select optionKey="id" from="${AssetSubItem.list()}" name="parentItem.id" value="${assetSubItemInstance?.parentItem?.id}" noSelection="['null':'']"></g:select>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="assetSubItemExtendedAttributes">Asset Sub Item Extended Attributes:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:assetSubItemInstance,field:'assetSubItemExtendedAttributes','errors')}">
+                                    
+<ul>
+<g:each var="a" in="${assetSubItemInstance?.assetSubItemExtendedAttributes?}">
+    <li><g:link controller="assetSubItemExtendedAttribute" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
+</g:each>
+</ul>
+<g:link controller="assetSubItemExtendedAttribute" params="['assetSubItem.id':assetSubItemInstance?.id]" action="create">Add AssetSubItemExtendedAttribute</g:link>
+
                                 </td>
                             </tr> 
@@ -92,12 +94,12 @@
                                     <label for="maintenanceActions">Maintenance Actions:</label>
                                 </td>
-                                <td valign="top" class="value ${hasErrors(bean:assetTypeInstance,field:'maintenanceActions','errors')}">
+                                <td valign="top" class="value ${hasErrors(bean:assetSubItemInstance,field:'maintenanceActions','errors')}">
                                     
 <ul>
-<g:each var="m" in="${assetTypeInstance?.maintenanceActions?}">
+<g:each var="m" in="${assetSubItemInstance?.maintenanceActions?}">
     <li><g:link controller="maintenanceAction" action="show" id="${m.id}">${m?.encodeAsHTML()}</g:link></li>
 </g:each>
 </ul>
-<g:link controller="maintenanceAction" params="['assetType.id':assetTypeInstance?.id]" action="create">Add MaintenanceAction</g:link>
+<g:link controller="maintenanceAction" params="['assetSubItem.id':assetSubItemInstance?.id]" action="create">Add MaintenanceAction</g:link>
 
                                 </td>
@@ -106,8 +108,15 @@
                             <tr class="prop">
                                 <td valign="top" class="name">
-                                    <label for="name">Name:</label>
+                                    <label for="subItems">Sub Items:</label>
                                 </td>
-                                <td valign="top" class="value ${hasErrors(bean:assetTypeInstance,field:'name','errors')}">
-                                    <input type="text" id="name" name="name" value="${fieldValue(bean:assetTypeInstance,field:'name')}"/>
+                                <td valign="top" class="value ${hasErrors(bean:assetSubItemInstance,field:'subItems','errors')}">
+                                    
+<ul>
+<g:each var="s" in="${assetSubItemInstance?.subItems?}">
+    <li><g:link controller="assetSubItem" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
+</g:each>
+</ul>
+<g:link controller="assetSubItem" params="['assetSubItem.id':assetSubItemInstance?.id]" action="create">Add AssetSubItem</g:link>
+
                                 </td>
                             </tr> 
