Hi,
I trying to use the Pallet component in my custom page. The data gets
populated populated properly. The Available list has the list of "roles"
(Entity object) which hare not already selected. The problem is with the
Select and Deselect button. For some reason they are always disabled. I'm
not sure why this is happening and any insight which I missed out would be
appreciated. Please find the code below:

Java:
        @Persist
        private List<Role> _roles;

        private final ValueEncoder<Role> _encoder = new RoleEncoder();

        @Inject
        SelectModelFactory selectModelFactory;

        public List<Role> getRoles() {
                return new ArrayList<Role>(user.getRoles());
        }

        public void setRoles(List<Role> roles) {
                _roles = roles;
        }

        public ValueEncoder<Role> getEncoder() {
                return _encoder;
        }

        public SelectModel getModel() {
                SelectModel model  =selectModelFactory.create(roleDao.getAll(),
"roleDesc");
                return model;
        }

tml:
<t:palette selected="roles" model="model"
                                        encoder="encoder" ></t:palette>

Encoder:
public class RoleEncoder implements ValueEncoder<Role> {

        @Inject
        private RoleDao roleDao;

        @Inject
        private Messages messages;

        public String toClient(Role value) {
                return value.getRoleKey();
        }

        public Role toValue(String clientValue) {
                return roleDao.read(clientValue);
        }

}

Thanks,
Srijith



-----
--
Don't Forget to Rate
--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-Pallet-tp5714869.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to