Following this cool tutorial of Not Only an ECM Place, I aimed to write a custom Editor containing several elements and a field associated to the Property. This custom Editor will be installed through an ICN Plugin. Since the property is multi-valued, the editor will be embedded inside a PropertyTable
editor.
Relevant files here are:
- The Plugin JavaScript file which will register the plugin (in the global
ControlRegistry
object of ICN) - The custom Editor JavaScript file which will extend both the custom Widget and the
_EditorMixin
class which maps the Widget to the Property - The custom Widget JavaScript file with a dojo HTML template
Below the attempt to make the Editor width resizable. In the Editor registration code, I used a DimensionSetting
and tried to override onSettingChanged() to make the Editor Widget resizable:
require([ /* [...] */],
function(lang, ) {
var editorId = "theWannaBeResizeableEditor";
ControlRegistry.editors.editorConfigs[editorId] = {
label: "A dummy label",
editorClass: AWannaBeResizeableEditor,
settings:
[
{
name: "width",
controlClass: DimensionSetting,
controlParams: {
label: resources.styleSettingsLabel.width,
help: resources.styleSettingsHelp.width
},
defaultValue: "100%",
// And here begins the problem...
onSettingChanged: function(helper, width) {
// Tried to resize the Widget : FAIL
}
} // [...]
]
}
});
I tried, amongst others, this implementation:
onSettingChanged: function(helper, width) {
helper.updateSetting("width", width);
helper.widget._adjustSizing && helper.widget._adjustSizing();
helper.widget.view.resize();
}
It didn't work. The Redbooks aren't very talkative about custom Widgets, so - except the tutorial I mentioned previously, it's hard to find information except by "reverse engineering", a big word for JavaScript objects exploration...