Hi,

we have a list which gets updated via ajax. This works fine. I'm trying to
get it so that the style attribute is updated as well. However even though
I put break points in the getObject() and I can see its got the new User
object the style attribute sent back via ajax is the old one even though
the new user label is the correct one.

Any ideas ?


getAssignlistContainer().add( new DataView<User>("assignlist", provider)

{

 @Override

protected void populateItem(final Item<User> item)

{

item.setDefaultModel(new CompoundPropertyModel<User>((IModel<User>)
item.getDefaultModel()));

Label name = new Label("name");

item.add(name);

if (item.getModelObject() != null)

name.add(AttributeModifier.replace("style", new Model<String>()

{

@Override

public String getObject()

{

User u = item.getModelObject();

String f = "background-color: " +
LabelColourProvider.getColour(u.getInitials());

return f;

}

}));

 }

});

Reply via email to