I have a component that has a certain property applied in a dialog. This component has a parsys for dragging in other components.
These 'child' components need to be able to read a property from the 'parent' component. How can this be achieved using the Javascript-use API?
Solved! Go to Solution.
Here an example:
"use strict";
use(function () {
var parent = resource.getParent();
var props = parent.adaptTo(Packages.org.apache.sling.api.resource.ValueMap);
return props.get("jcr:createdBy","");
});
Views
Replies
Total Likes
Here an example:
"use strict";
use(function () {
var parent = resource.getParent();
var props = parent.adaptTo(Packages.org.apache.sling.api.resource.ValueMap);
return props.get("jcr:createdBy","");
});
Views
Replies
Total Likes
BTW I raised this issue to make the getValueMap() available, to save a line of code :-)
Thanks! This is perfect (minus the extra line of code of course).
PS, I attended your sessions at Summit this year, really enjoyed them!
Views
Replies
Total Likes
thanks for the feedback!
Views
Replies
Total Likes
Views
Likes
Replies