I thought I would just share what I found out, after I got it to work:
So you have to declare an interface the so called “CustomAPI” and in here you will have to declare what methods you want to use. What confused me was the things defined inside “interface CustomAPI { … }” in line 3-7 of the attached example. However in the case you only want to set the DataModel you’ll only need a method called something like “setChildDataModel( … );” or whatever.
When you’ve done this, you will have to implement this interface to the child node like line 13 in the attached example, and then override the “setChildDataModel( … );” with the functionality you want like the other picture I’ve uploaded, which is my method.
Now you can, with the help of the CustomAPI, access this method in the parent node with childAs.setChildDataModel(…); like it is done in the example from line 20. Here they are accessing the method childAs.setSetting( … );
I hope this is clear if anyone needs it, and i apologize if my terminology is wrong as I’m not an experienced Java programmer.
3 Likes