I think I've found the problem that's been plaguing me since the last big checkin - or I've gone insane from too many hours of debugging :lol:
I could certainly be missing something subtle, but it appears that child form models are not being commited when the parent form model is commited.
The code in AbstractFormModel for addChild and setParent look like this:
Things are setup so dirty-ness propogates up and enabled-ness propogates down, but nothing in that code wires to two together for commits. Shouldn't there be some connection between the children and the parent so that the commit on the parent is propogated down to all the children in the hierarchy?Code:public void addChild(HierarchicalFormModel child) { Assert.required(child, "child"); Assert.isTrue(child.getParent() == null, "Child form model '" + child + "' already has a parent"); child.setParent(this); child.addPropertyChangeListener(DIRTY_PROPERTY, dirtyChangeHandler); } public void setParent(HierarchicalFormModel parent) { Assert.required(parent, "parent"); this.parent = parent; this.parent.addPropertyChangeListener(ENABLED_PROPERTY, parentEnabledChangeHandler); }
Would the right solution be to fix the problem where the child form models are not being added to the child collection and then use that collection in the commit method to call commit() on each child form model?
Actually it would be a little more complex than that since you'd need to give all the nested form models and chance to veto the commit, but is this even on the right track?
Thanks.
Larry.


Reply With Quote