I have a page that takes gets a number of guids, then creates an input
form to collect more data from the user. How do I
#foreach($key in $cachedkeys)
#beforeall
$Form.FormTag("%
{id='loadboundariesform',area='admin',controller='boundary',action='load'}")
$Form.FieldSet("Select boundaries to import")
<table>
<tr>
<th>Force</th>
<th>Code</th>
</tr>
#each
<tr>
<td>
$Form.HiddenField('LoadBoundary.Id',$key.Id)
$Form.TextField('LoadBoundary.Force')
</td>
<td>
$Form.TextField('LoadBoundary.Force')
</td>
</tr>
#afterall
</table>
#end
$Form.Submit("Submit", "%{id='submitList'}")
$Form.EndFieldSet
$Form.EndFormTag
My LOAD action looks like
public void Load([DataBind("LoadBoundary", From = ParamStore.Form)]
LoadBoundary[] load)
so I want to bind the results of the form to an array of LoadBoundary
dto's.
I know that I need my output to be like:
<tr>
<td>
<input type="hidden" id="LoadBoundary_0_Id"
name="LoadBoundary[0].Id"
value="CED3BD4B-3EFB-4abd-85C6-588554CADAE8" />
<input type="text" id="LoadBoundary_0_Force"
name="LoadBoundary[0].Force" />
</td>
<td>
<input type="text" id="LoadBoundary_0_Force"
name="LoadBoundary[0].Code" />
</td>
</tr>
<tr>
<td>
<input type="hidden" id="LoadBoundary_1_Id"
name="LoadBoundary1].Id" value="99F02D89-0B56-4817-9220-FB0C08236F09" /
>
<input type="text" id="LoadBoundary_1_Force"
name="LoadBoundary[1].Force" />
</td>
<td>
<input type="text" id="LoadBoundary_1_Force"
name="LoadBoundary[1].Code" />
</td>
</tr>
I've tried building the Id & Name manually with a loop & a counter,
but the parser borks, creates id's of "LoadBoundary[$counter].Id", or
I duplicate name attributes.
Am I missing a trick or do I have to create element manually?
Thanks in advance.
Ben
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---