Revision 843f2ff8
Added by Andreas Kohlbecker almost 7 years ago
src/main/java/eu/etaxonomy/vaadin/mvp/AbstractPopupEditor.java | ||
---|---|---|
41 | 41 |
import com.vaadin.ui.VerticalLayout; |
42 | 42 |
import com.vaadin.ui.themes.ValoTheme; |
43 | 43 |
|
44 |
import eu.etaxonomy.vaadin.component.NestedFieldGroup; |
|
44 | 45 |
import eu.etaxonomy.vaadin.component.SwitchableTextField; |
45 | 46 |
import eu.etaxonomy.vaadin.ui.view.DoneWithPopupEvent; |
46 | 47 |
import eu.etaxonomy.vaadin.ui.view.DoneWithPopupEvent.Reason; |
... | ... | |
75 | 76 |
mainLayout.setWidthUndefined(); |
76 | 77 |
|
77 | 78 |
fieldGroup = new BeanFieldGroup<>(dtoType); |
78 |
fieldGroup.setBuffered(false); |
|
79 | 79 |
fieldGroup.addCommitHandler(new SaveHandler()); |
80 | 80 |
|
81 | 81 |
setCompositionRoot(mainLayout); |
... | ... | |
248 | 248 |
|
249 | 249 |
protected <T extends Field> T addField(T field, String propertyId) { |
250 | 250 |
fieldGroup.bind(field, propertyId); |
251 |
if(NestedFieldGroup.class.isAssignableFrom(field.getClass())){ |
|
252 |
((NestedFieldGroup)field).registerParentFieldGroup(fieldGroup); |
|
253 |
} |
|
251 | 254 |
addComponent(field); |
252 | 255 |
return field; |
253 | 256 |
} |
... | ... | |
271 | 274 |
protected <T extends Field> T addField(T field, String propertyId, int column, int row) |
272 | 275 |
throws OverlapsException, OutOfBoundsException { |
273 | 276 |
fieldGroup.bind(field, propertyId); |
277 |
if(NestedFieldGroup.class.isAssignableFrom(field.getClass())){ |
|
278 |
((NestedFieldGroup)field).registerParentFieldGroup(fieldGroup); |
|
279 |
} |
|
274 | 280 |
addComponent(field, column, row); |
275 | 281 |
return field; |
276 | 282 |
} |
... | ... | |
293 | 299 |
throws OverlapsException, OutOfBoundsException { |
294 | 300 |
if(propertyId != null){ |
295 | 301 |
fieldGroup.bind(field, propertyId); |
302 |
if(NestedFieldGroup.class.isAssignableFrom(field.getClass())){ |
|
303 |
((NestedFieldGroup)field).registerParentFieldGroup(fieldGroup); |
|
304 |
} |
|
296 | 305 |
} |
297 | 306 |
addComponent(field, column1, row1, column2, row2); |
298 | 307 |
return field; |
Also available in: Unified diff
ref #6612 support for editor widgets with nested FieldGroups