I have a class that I am using for each row in a grid, it is the mix of multiple entities data. the question is where to put it? I tried placing the class in the component package and instantiating it within my page, tried returning the class from an injected service, and nesting the class within the page POJO. in all cases it will work once and then on refresh I get this error:
Failure writing parameter 'row' of component admin/Add:grid.rows: Failure writing parameter 'row' of component admin/Add:grid: Could not find a coercion from type com.foo.bar.pages.admin.Add$RolesRow to type com.foo.bar.pages.admin.Add$RolesRow. here is the class public static class RolesRow{ @Property public Boolean ROLE_SUPER; @Property public Boolean ROLE_ADMIN; @Property public Boolean ROLE_USER; @Property public Boolean ROLE_VIEW; @Property public Boolean ROLE_EMAIL; private Map<String,Role> roles; public RolesRow(){ } public RolesRow(Map<String,Role> roles){ ROLE_SUPER = (roles.containsKey("ROLE_SUPER") ? true:false); ROLE_ADMIN = (roles.containsKey("ROLE_ADMIN") ? true:false); ROLE_USER = (roles.containsKey("ROLE_USER") ? true:false); ROLE_VIEW = (roles.containsKey("ROLE_VIEW") ? true:false); ROLE_EMAIL = (roles.containsKey("ROLE_EMAIL") ? true:false); this.roles = roles; } public List<Role> selected(){ List<Role> r = new ArrayList<Role>(); checked(r,"ROLE_SUPER",ROLE_SUPER); checked(r,"ROLE_ADMIN",ROLE_ADMIN); checked(r,"ROLE_USER",ROLE_USER); checked(r,"ROLE_VIEW",ROLE_VIEW); checked(r,"ROLE_EMAIL",ROLE_EMAIL); return r; } private void checked(List<Role> r,String field,Boolean obj){ if (obj !=null && obj == true){ r.add(roles.get(field)); } } I am instantiating the record in setupRender: void setupRender(){ List<RolesRow> list = new ArrayList<RolesRow>(); list.add(new RolesRow()); -- View this message in context: http://old.nabble.com/Where-to-define-this-class--tp29100001p29100001.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