You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Cameron Cole <cw...@yahoo.com> on 2002/02/17 19:55:28 UTC

Intake, Torque/Peers and HTML forms

Hello all,

I have been playing with Turbine for the past few days and have a small
application working. Of course a few questions have arisen and I have
been unable to find the answers to these questions so I thought I would
post a quick note to the list.

1. Intake can create the binding between an html form and a java object.
What, if possible, is the best practise to create bindings between
multiple objects in a list and multiple form elements? I can probably
explain what I mean better with an example. Consider a simple inventory
mgmt system with only one simple object an Inventory.class item. If
someone wishes to "check out" a piece of inventory, or several pieces of
inventory, they need to give a reason for each piece of inventory they
are checking out. The velocity template would look something like this
(condensed):

<table>
#foreach ($item in $inventory)
	<tr>
	<td><input type="checkbox" name="id" value="$item.id"></td>
	<td>$item.name</td>
	<td><input type="text" name="help here" value=""></td>
	</tr>
#end
	<tr>
	<td colspan="3">
	<input type="submit" name="eventSubmit_doSomething" value="Checkout">
	</td>
	</tr>
</table>

It is easy to create the association between the checkboxes and the true
java objects via their unique id and the properties of a checkbox/radio
button/drop down list. However, how can I create a unique binding
between each java object and the text box? I don't want to do something
like: <input type="text" name="reason:$item.id"> and then have to parse
it out in the action. It also ruins all the neat bindings you can do
with peers and the intake service.

Is there a document I have missed reading or misinterpreted while
reading? If so can someone please shed some light on this problem. Must
I do parsing in the action?

Thanks in advance for your help,

-cam.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>