Discussion:
Example: Placing a repeater-widget within fi:group?
Stephan Coboos
2004-09-01 08:46:54 UTC
Permalink
Hello,

has someone an example how to place a repeater-widget within a fi:group tab?
Each element from the repeater-widget should displayed as single row and the
labels should appear only once as table header like in the cocoon examples
for contacts. But these example doesn't use the fi:group element and I can't
find out how to format a repeater-widget like in the examples but within a
fi:group.

Thank you.

Regards
Stephan
Stephane Delort
2004-09-01 12:11:49 UTC
Permalink
hope the followinf code will help you .......

***************** definition file

<fd:repeater id="mP" initial-size="2">
<fd:widgets>
<fd:field id="MPLabel">
<fd:label>1.4 Measurement Procedures :</fd:label>
<fd:datatype base="string"/>
</fd:field>

<fd:field id="directive">
<fd:label>Directive</fd:label>
<fd:datatype base="string"/>
<fd:selection-list type="flow-jxpath" list-path="mpDirective" value-path="value" label-path="label" dynamic="true"/>
</fd:field>

</fd:widgets>
</fd:repeater>
<fd:repeater-action id="addMP" action-command="add-row" repeater="mP">
<fd:label>Add Measurement Procedure</fd:label>
</fd:repeater-action>

***************** template file
<fi:group>
<fi:styling type="fieldset" />
<fi:items>
<ft:widget-label id="mP"/><br/>
<ft:repeater-size id="mP" size="1" />
<ft:repeater-widget-label id="mP" widget-id="MPLabel"/>
<table border="1">
<tr>
<td rowspan="2"> Reference </td>
<td rowspan="2"><ft:repeater-widget-label id="mP" widget-id="directive"/> </td>
</tr>
<tr> </tr> <!-- this line is a hack to have a good output -->
<ft:repeater-widget id="mP">
<tr>
<td><ft:widget id="MPLabel"/></td>
<td><ft:widget id="directive"/> </td>
</tr>
</ft:repeater-widget>
</table>
<td align="center">
<ft:widget id="addMP"/>
</td>
<td align="center">
<ft:widget id="removeMP"/>
</td>
</fi:items>
</fi:group>

Loading...