On Sat, 21 Jun 2008, Kai Mütz wrote: > I have no idea how to implement such a model. Do you have any hint? I am not > sure where/when exactly the IModel.getObject() method is called and where > the missing values can be inserted.
Something like this, I'm not sure if I got your requirements right but maybe this will get you started: protected void populateItem(final ListItem item) { Check check = new Check("check", new Model() { @Override public void setObject(Object object) { if (!isEnabled()) { return; } Boolean enableRole = (Boolean) object; if (enableRole) { user().addRole(getRoleOf(item)); } user().removeRole(getRoleOf(item)); } @Override public Object getObject() { return user().hasRole(getRoleOf(item)); } }); getObject() of the Check is called at least when the Check is rendered, to be able to tick it or not as needed. If you are really interested, you can always put Thread.dumpStack() in getObject() to see when it is called and by whom. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations Oy <URL: http://www.ri.fi/ > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]