Hi,

I am new to Tapestry and have started a project where we want to use
Tapestry 5.

My question is about how I can use the  loop and checkbox with my code.

I will have a few objects to play with like User and Category.  User has a
Set of Category objects.  Category just holds an id and string that is
really a message key (for localization).

So on say the Category.html page we want to show a list of categories with a
checkbox next to each one that the user can check.
When the user submits the form we want to stuff the checked Category objects
into the User's Set.

So my Category.html might have something like
<t:form>
<tr t:type="loop" source="myList" value="rowitem">
   <td><input t:type="checkbox" t:id="myCategory" t:value="rowitem.checked"
/>${rowitem.label}</td>
</tr>
<input type="submit" />
</t:form>

Are those attributes right?
Can anyone point me in the right direction for what the Category.java should
have in it?

I think I have managed to get the rowitem.label appearing with a simple list
eg

@persist
private List myList = new ArrayList();
public List getMyList();
public void setMyList(List _myList);

(I have it populated in the constructor as an example)

What where do the values of checkbox go?  Is it some sort of indexed
property?

getMyCategory()
setMyCategory(what type goes here?)

any hints (or complete examples ;) ) would be welcome

--
Jason Lea

Reply via email to