How to implements a class in my current class and access his method ?
I want to return the value of variable teste2 inside my current class but I can't return correctly this value what I need to do?
Here below there's the code to test
HTL
<sly
data-sly-use.cameraModel="com.mysite.core.models.CameraCardsList"
data-sly-test="${cameraModel.listItems.size>0}"
data-sly-use.fragmentTemplate="mysite/components/block_cameraGroup/templates.html"
>
</sly>
Model CameraCardsList (class)
public class CameraCardsListImpl extends AbstractComponentImpl implements CameraCardsList, GetFragmentConcessionary {
private GetFragmentConcessionary delegate = new GetFragmentConcessionaryImpl();
@9944223
public String getTeste() {
return delegate.getTeste();
}
}
model GetFragmentConcessionary (class)
public class GetFragmentConcessionaryImpl implements GetFragmentConcessionary{
public String teste2 = "outConstructor";
@PostConstruct protected void init() throws RepositoryException {
teste2 = "inConstructor";
}
@9944223 public String getTeste() {
return teste2;
}
}
CameraCardsList (interface)
public interface CameraCardsList extends Component{
}
GetFragmentConcessionary (interface)
public interface GetFragmentConcessionary extends Component {
public String getTeste();
}