> 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?
Are you using it in more than one page? With a tiny view class I sometimes just stick it right in the page/component that uses it. Otherwise, like Thiago said, you need to put it in a package that's not special to tapestry. How about /viewobject or /vo By the way > �...@property public Boolean ROLE_SUPER; This only works in your page and component classes. You'll need to create your own getter/setters. Josh On Wed, Jul 7, 2010 at 3:59 PM, ebt <no.spam.tal...@gmail.com> wrote: > > 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 > > -- -- http://www.bodylabgym.com - a private, by appointment only, one-on-one health and fitness facility. -- http://www.ectransition.com - Quality Electronic Cigarettes at a reasonable price! -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org