| Summary: | MasterDetailsContentNode's property editors don't refresh when the associated property is changed | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Shenxue Zhou <shenxue.zhou> |
| Component: | Sapphire | Assignee: | Konstantin Komissarchik <konstantin> |
| Status: | RESOLVED INVALID | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Shenxue Zhou
The bug description isn't very accurate. What I should have said was it needs to listen on parent element for changes on the property associated with the definition. Let me explain: line 120 of MasterDetailsContentNode class: this.modelElementProperty = (ImpliedElementProperty) resolve( this.definition.getProperty().getContent() ); I have a use case with a very peculiar custom implied element binding on such a property on my root element. When that property changes between two states, the rest of the model needs to access different parts of the xml file. So the underlying resource for the binding changes. The result is the model element for that property is reconstructed. MasterDetailsContentNode doesn't handle that case. Once its instance variable this.modelElement is assigned, it's set for the life cycle of the form editor. I think an easy way to fix it (probably not the best way) is when such a change occurs, all the parts need to be recreated. Based on your description, it sounds like the problem is in your binding and/or lack of @DependsOn annotations. The model element held by an ImpliedElementProperty never changes for the duration of its parent's lifespan. The XML node underlying that element can change, but not the element itself. I believe what you need to do is to add @DependsOn( "/MySwitch" ) to every property starting with the root of the model that may be affected by the switch. This includes properties inside implied element properties, but not inside list properties or regular element properties. |