Bind to Set using Listbox

asked 2011-04-15 11:18:17 +0800

davidH gravatar image davidH

I am using the zkgrails plugin and have the following classes...

	public enum UserRole {
	    SYSTEMS_ADMINISTRATOR('Systems administrator'),
	    PROJECT_OWNER('Project owner'),
	    PROJECT_MEMBER('Project member')

	    String name

	    UserRole(String name) {
	      this.name = name

	class User{
	    String firstName
	    String lastName
	    Set<UserRole> roles
	    static hasMany = [roles: UserRole]

	    static constraints = {

... and would like to create a zul page to allow users of the application to display a list of all possible roles and then check off the ones they would like to assign to a user.

What is the best zk widget to use? I have been using a listbox with checkmarks enabled.

How do I display all of the user roles (UserRole.values()) on the zul page and then bind a user's selections to the "Set<UserRole> roles" property in the User object?

Thank you in advance.

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2012-09-11 05:58:30 +0800

paowang gravatar image paowang
140 6

check this:

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools




Asked: 2011-04-15 11:18:17 +0800

Seen: 329 times

Last updated: Sep 11 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More