I have question like I have a slingmodel XYZ and created a component and dialog for sling model XYZ.
From the same component dialog how to inject sling model ABC without using Mulitfield in dialog.
So how to design dialog and sling model for this purpose.
@Model(adaptables = "Resource.class", defaultInjectionStrategy = DefaultInjectionStrategy.Optional)
public class Xyz {
@getter
@inject
private String A;
@getter
@inject
Private ABC bclass;
}
@Model(adaptables = "Resource.class", defaultInjectionStrategy = DefaultInjectionStrategy.Optional)
public class ABC {
@inject
private String C;
@inject
private String D;
}
Solved! Go to Solution.
@Model(adaptables = "Resource.class", defaultInjectionStrategy = DefaultInjectionStrategy.Optional) public class Xyz { @getter @inject private String A; @Self Private ABC bclass; }
@Model(adaptables = "Resource.class", defaultInjectionStrategy = DefaultInjectionStrategy.Optional) public class ABC { @getter @inject private String C; @getter @inject private String D; }
Using the @Deleted Account annotation, you will be able to achieve this.
Reference Details: https://taradevko.com/aem/sling-models-self-annotation/
Hope this helps!
Thanks
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies