Cool, thank you very much.
My template is this...
<!--$extends skeleton.html-->
<div id="bodyarea">
<h1>${actionName} an Index</h1>
<div a:if="error">${error}</div>
<form action="${base_url}${action}" method="POST">
Name:<br/>
<input a:if="edit" autofocus="autofocus" type="text" name="${action}" value="${indexName}" readonly="readonly" />
<input a:else autofocus="autofocus" type="text" name="${action}" value="${indexName}" /><br/>
<h2>Access</h2>
<label for="${allowed_users_param}">Allowed Users:</label><br/>
<span a:if="edit">(you are automatically allowed access)</span>
<select multiple="multiple" size="${size}" name="${allowed_users_param}">
<a:span a:foreach="userDetails.keySet()" a:as="user">
<option a:if="userDetails[user]" value="${user.userId}" selected="selected">${user.nickname}</option>
<option value="${user.userId}" a:else >${user.nickname}</option>
</a:span>
</select><br/>
<small>Admin users are always allowed access</small><br/>
<input a:foreach="usersUsedToBeAllowed" a:as="user" type="hidden" value="${user}" />
<input a:if="edit" type="submit" value="Update"/>
<input a:else type="submit" value="Create"/>
</form>
</div>
and my template contains quite a lot of fields but the relevant one is a Map<User,Boolean> to say if the user is allowed access to the item in question.
It's actually all working now, but it stops working with the error I gave if I swap the attributes a:each and value="${user.userId}"
Mat.