I've been reading other posts but nothing seems to work for me.

Here's my page:

public class ServiceActivation {                
        private List<User> users;
        
        @Property 
        private UserService userservice;
        
        @Property
        private User u;
        
        @Inject
        private UserDao userDao; 
        
        public List<User> getUsers() {
                if (users == null) {
                        users = userDao.findAll();                      
                } 
                return users;
        }
        
        public void onSuccess(UserService userservice) {
                System.out.println(userservice);
        }
}

A user has a List<UserService> that gets loaded at userDao.findAll() along
with the User. I have a form that I want to loop through all the users and
give them an option to 'activate' a service, contained in the userservice
object. I'm just posting the nested loops because I can't format the whole
thing nicely, but it's within a form and there is a sbumit button for each
nested iteration:

<t:loop source = "users" value = "u" formState = "none">
    <t:loop source = "${u.userServices}" value = "userservice" formState =
"none">
    </t:loop>
</t:loop>

Inside both loops I try to access properties of u and userservice. 
                                        
I get this error message:
Render queue error in BeginRender[service/Activation:loop_0]: Failure
writing parameter 'value' of component service/Activation:loop_0: Could not
find a coercion from type java.lang.String to type
org.synchronica.example.entities.userservice.UserService.

I've read that formState = "none" does something in this case but I don't
understand it. There's also the ValueEncoder I don't understand, but I don't
want to make a database call for each item in the list (if that's the way to
implement it).



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/5-3-6-Loop-component-giving-coercion-error-tp5718395.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