Certainly...
What I did to generate a dynamic checkbox
Home.html
<table cellspacing="10">
<tr>
<td>Name</td>
<td>ID</td>
</tr>
<tr>
<td colspan="3"><hr></td>
</tr>
<tr jwcid="@For"
source="ognl:groups" value="ognl:group" element="tr">
<td>
<span jwcid="@Checkbox"
selected="ognl:group.checked"/>
</td>
</tr>
</table>
For the above html template you'll need
An abstract method for getting groups (as in source="ognl:groups")
//Home.java
public List getGroups() {
return getGroupManager().getGroups();
}
The getGroups method returns a list of group objects - hence the
value="ognl:group" in the html template.
Now we need to insert some stuff in the @For loop... that's our
checkboxes, and it's done with:
<span jwcid="@Checkbox" selected="ognl:group.checked"/>
In the above line @Checkbox is the Tapestry component and
selected="ognl:xxx" is our Boolean value for the object
in this case "selected="ognl:group.checked" is a Boolean value from our
group object. Hopefully there's no bigger errors in the above example
Good references on how to do this in case this example doesn't do it for
you:
http://jakarta.apache.org/tapestry/tapestry/ComponentReference/For.html
http://www.tapestryforums.com/-vp3327.html
Cheers
Wayland Chan wrote:
Nima,
For the benefit of others who may search the list archives at some point,
woud you please provide a short summary of what your fix was.
Thanks.
On 3/9/06, Nima Boustanian <[EMAIL PROTECTED]> wrote:
Nevermind, solved it! Thanks Wayland! :)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]