Hello,

In order to make some sense to you all, first let me clarify a bit what
my VOs look like. It's called a ModelObjectVO, which has a Map of
AttributeVOs. All AttributeVOs are based on an AttributeDefinitionVO.
These attributes are accessed via a call to
ModelObjectVO#getAttribute(AttributeDefinitionVO). They all return one
or more values, depending on the type (numeric, text, listed, etc). 

What grabbed my enthousiasm, was the feature of the FormTable with the
FieldColumns. I put an AttributeDefinitionVO in my custom FieldColumn,
and the right value was returned by overriding
FieldColumn#getProperty(Object) method. 

Now comes the anti-climax: when that form is submitted, there is no way
to manually set the value for that field. Since the name of the Field
will look like "SA_15", the Ognl lib will look for a property
ModelObjectVO#setSA_15(Object) which is obviously not going to work,
since the value needs to be set on the AttributeVO. 

I immediately wanted to override FieldColum#setValue(), but there was
none :(. Then I was thinking to override Page#onPost() to intercept the
values, but onPost is called *after* Control#onProcess(), where Ognl
bombs out.

Setting the value through Ognl is a nice feature, but, again, just like
all the other frameworks (JSF, Spring, Struts) only work for simple,
bean-like structures. That's the main reason I turned my back on JSF and
Spring, lack of support for complex VOs. Wrapping the ModelObjectVO to
have a gazillion getters/setters is not even an option since the user is
able to define his own AttributeDefintionVOs, so you never know what
you're going to end up with, attribute wise.

What is the best practice for setting values on complex VOs?? Displaying
them is easy, submitting them is a different story...

Sorry for the long boring story, but this is a problem I run into with
every web framework. Thanks for thinking along.

Cheers,

WarnerJan

Reply via email to