Reputation: 3785
I want to edit a DTO which is a composition of values and other DTOs. For some of this subdtos I already have a working Editor which are defined as Composite. The structure is like this:
public class TopDto {
private SubDto subDto;
public SubDto getSubDto();
public void setSubDto(...);
}
public class TopEditor extends Composite implements Editor<TopDto> {
@UiField
SubEditor subEditor;
}
public class SubEditor extends Composite implements Editor<SubDto> {
}
So while SubEditor is a working Editor for SubDto I don't know how to say TopEditor that the UiField subEditor is actually editing the property and is not the property itself.
What i tried so far is to set @Ignored and initialize subEditors driver with the subDto property from TopDto. But that is not working as expected. In fact the problem is that its not descending down to call subEditor.driver.flush() when I call driver.flush() in TopEditor.
Since the drivers are private (or protected) I cannot explicitly call driver.flush() of the SubEditor and manually change the SubDto in TopDto with that. So what I did now as work around is giving a public getSubDto() method to the SubEditor which gives me the Dto and then manually insert it. But from what i understand from the spare documentation thats not the intended workflow so I'm doing something wrong here.
Can someone maybe provide me with an example or help me build one how to do this as intended?
Upvotes: 1
Views: 94
Reputation: 1015
Have you tried using the @Path annotation to map Editors to bean properties?
Upvotes: 1