PDA

View Full Version : Nested bean in a ModelData



sdc
12 Jun 2009, 6:48 AM
Hi,

Nested bean in a ModelData is partially supported : it works only if your bean implements BeanModelTag but not if there is a marker with a @BEAN annotation.

My suggestion : in NestedModelUtil, replace

public static Object convertIfNecessary(Object obj) {
if (obj instanceof BeanModelTag) {
BeanModelFactory factory = BeanModelLookup.get().getFactory(obj.getClass());
obj = factory.createModel(obj);
}
return obj;
}
with


public static Object convertIfNecessary(Object obj) {
BeanModelFactory factory = BeanModelLookup.get().getFactory(obj.getClass());
if(factory != null)
obj = factory.createModel(obj);
return obj;
}

sven
12 Jun 2009, 7:03 AM
Thanks for looking into this. We look into making this chance.