Nested object's properties labels & validation
I am having two (related) problems with nested object properties. The first is that the form is not displaying the labels for a nested object's properties. The second is that no validations (i.e. RuleSource...) are applied to the nested object's properties either. If the nested object is put on the form by itself, the labels and validation show up on the form.
Example,
Code:
class Aggregate
Child child;
Child getChild() {return child;}
class Child
String value;
String getValue(){return value;}
In the message file,
Code:
value.label=Value:
If an instance of Child is put on to a form, the label "Value:" show up.
On the form for Aggregate, I have added "child.value" on the form but the label for value did not show up. The string "child.value.label" is displayed instead. The validation for value is not applied to the field either.
I have found two workarounds so far for the labels part of the problem; both of which seem rather kludgy. The first, is to add another entry in the message file... i.e.
Code:
child.value.label=Value
value.label=Value
Shouldn't it be able to pick up the label for value for the nested object child instead of having to duplicate the entries in the message file?
The second is for a to "nest" itself. e.g.
Code:
class Child
{
String value;
String getValue(){return value;}
Child getChild()
{
return this;
}
}
This way I can have 1 entry in the message file, but writing a getter to get a reference to an instance of myself seems a bit odd.
Any comments, folks?
Thanks
Henry