Read control nodes and update widget properties
Functions covered
Composition structure
Composition script
Last updated
Last updated
(function() {
return {
init: function(comp, context) {
// get reference to the fullname widget
const wiLowerFullname = comp.findWidget("lowerFullname")[0];
// get control node payload as JSON object
const p = comp.getPayload2();
console.log(p);
// concat control node content and change the lastname to upper case.
const fullname = `${p["Firstname"]} ${p["Lastname"].toUpperCase()}`;
// update fullname text
wiLowerFullname.setPayload({
"text": fullname
});
},
close: function(comp, context) {}
};
})();