taylor 2004/11/10 17:48:25
Modified: portals-bridges/library/velocity/macros frameworks-macros.vm
Log:
more examples
Revision Changes Path
1.4 +46 -6
jakarta-jetspeed-2/portals-bridges/library/velocity/macros/frameworks-macros.vm
Index: frameworks-macros.vm
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/portals-bridges/library/velocity/macros/frameworks-macros.vm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- frameworks-macros.vm 4 Nov 2004 22:17:48 -0000 1.3
+++ frameworks-macros.vm 11 Nov 2004 01:48:25 -0000 1.4
@@ -1,21 +1,37 @@
#macro (headerCell $body)
- <td>
+ <th class="portlet-section-header">
<b>
$body
</b>
- </td>
+ </th>
#end
#macro (entryCell $body)
- <td>
+ <td class='portlet-section-body'>
$body
</td>
#end
-#macro (form4ColumnCell $label $value $size $id)
+#macro (entryCell2 $body $count)
+#if (($count % 2) == 0)
+ <td class='portlet-section-body'>
+#else
+ <td class='portlet-section-alternate'>
+#end
+ $body
+ </td>
+#end
+
+
+#macro (formField $label $value $size $id $MESSAGES $ERRORS)
+#if ($ERRORS)
+#set ($eflag = "$!ERRORS.get($id)")
+#else
+#set ($eflag = "")
+#end
<tr colspan="4" align="right">
- <td width="5%" class="portlet-form-label" align="left"> </td>
- <td nowrap class="portlet-form-field-label"
align="right">$!label: </td>
+ <td width="5%" class="portlet-msg-error" align="left">#if ($!eflag ==
"") #else x #end</td>
+ <td nowrap class="portlet-form-field-label"
align="right">$!MESSAGES.getString($label): </td>
<td class="portlet-form-input-field" align="left">
<input id="$!id" type="text" name="$!id" size="$!size" value="$!value">
</td>
@@ -23,10 +39,34 @@
</tr>
#end
+#macro (ErrorMessages $ERRORS)
+#if ($ERRORS)
+#if ($ERRORS.size() > 0)
+#foreach ($msg in $ERRORS)
+<div class="portlet-msg-error">
+$msg<br/>
+</div>
+#end
+<br/>
+#end
+#end
+#end
+
#macro (Preference $prefs $name)
#set ($pall = $prefs.get($name))
#foreach ($x in $pall)
#set ($extraction = $x)
#end
$extraction
+#end
+
+#macro (form4ColumnCell $label $value $size $id)
+ <tr colspan="4" align="right">
+ <td width="5%" class="portlet-form-label" align="left"> </td>
+ <td nowrap class="portlet-form-field-label"
align="right">$!label: </td>
+ <td class="portlet-form-input-field" align="left">
+ <input id="$!id" type="text" name="$!id" size="$!size" value="$!value">
+ </td>
+ <td width="5%" class="portlet-form-label" align="left"> </td>
+ </tr>
#end
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]