Get custom properties from another custom control

Here is a quick tipp that can make your work with custom controls easier.

Each custom contConrol can have a set of customproperties that are accessible vie compositeData.PropertyName. But also each custom control has it’s own propertyMap. This makes it impossible to access a custom property from ccParent by ccChild.

I have put together a small piece of JS that let you access the custom properties.

function getParentProperty(_this, parentProp){
var parentID = getComponent(getComponent(_this.getId()).getParent().getId()).getParent().getId();
if(null != parentID) {
var parentComponent = getComponent(parentID);
var parentProperties = parentComponent.getPropertyMap();
if(null != parentProperties) {
var ret = parentProperties.getProperty(parentProp);
}
}
return (null != ret)? ret:null;
}

Download sample database