Title: [waffle-scm] [628] trunk/examples/freemarker-example/src/main/webapp/people: Added FTL handling of missing values in freemarker-example.
Revision
628
Author
mauro
Date
2008-04-19 10:53:00 -0500 (Sat, 19 Apr 2008)

Log Message

Added FTL handling of missing values in freemarker-example.

Modified Paths


Diff

Modified: trunk/examples/freemarker-example/src/main/webapp/people/editperson.htm (627 => 628)

--- trunk/examples/freemarker-example/src/main/webapp/people/editperson.htm	2008-04-19 15:16:26 UTC (rev 627)
+++ trunk/examples/freemarker-example/src/main/webapp/people/editperson.htm	2008-04-19 15:53:00 UTC (rev 628)
@@ -28,7 +28,11 @@
     </div>
     <div class="fieldRow">
         <label for="" Of Birth:</label>
-        <@w.text "person.dateOfBirth" "${person.dateOfBirth?string('dd/MM/yyyy')}"/> 
+        <#if person.dateOfBirth??>
+            <@w.text "person.dateOfBirth" "${person.dateOfBirth?string('dd/MM/yyyy')}"/>
+        <#else>
+            <@w.text "person.dateOfBirth" ""/>
+        </#if> 
         <br style="clear:both"/>
     </div>
     <div class="fieldRow">
@@ -38,12 +42,12 @@
     </div>
     <div class="fieldRow">
         <label for=""
-        <@w.textAsCSV "person.levels" person.getLevels() /> 
+        <@w.textAsCSV "person.levels" person.getLevels()![] /> 
         <br style="clear:both"/>
     </div>
     <div class="fieldRow">
         <label for=""
-        <@w.textAsCSV "person.grades" person.getGrades() /> 
+        <@w.textAsCSV "person.grades" person.getGrades()![] /> 
         <br style="clear:both"/>
     </div>
 

Modified: trunk/examples/freemarker-example/src/main/webapp/people/person.htm (627 => 628)

--- trunk/examples/freemarker-example/src/main/webapp/people/person.htm	2008-04-19 15:16:26 UTC (rev 627)
+++ trunk/examples/freemarker-example/src/main/webapp/people/person.htm	2008-04-19 15:53:00 UTC (rev 628)
@@ -38,8 +38,8 @@
                 <td>${person.firstName}</td>
                 <td>${person.lastName}</td>
                 <td>${person.email}</td>
-                <td>${person.dateOfBirth?string("dd/MM/yyyy")}</td>
-                <td><@w.asCSV person.getSkills() /> </p></td>
+                <td><#if person.dateOfBirth??>${person.dateOfBirth?string("dd/MM/yyyy")}</#if></td>
+                <td><@w.asCSV person.getSkills()![] /> </p></td>
                 <td><@w.checkbox "selectedIds" "${person.id}" /></td>
             </tr>
         </#list>


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to