Want a multifield inside multifield in content fragment model , have tried with custom js and dialog but still not working any idea please share it .
Solved! Go to Solution.
Views
Replies
Total Likes
Define the outer multifield: In your Content Fragment Model, define the outer multifield as you normally would.
{
"title": "My Multifield",
"name": "./myMultifield",
"fieldLabel": "My Multifield",
"xtype": "multifield",
"addLabel": "Add Item",
"fieldConfig": {
"xtype": "textfield",
"name": "./myTextField",
"fieldLabel": "My Text Field"
}
}
Define the inner multifield: In the fieldConfig
object of the outer multifield, define the inner multifield as a custom xtype. For example:
{
"title": "My Multifield",
"name": "./myMultifield",
"fieldLabel": "My Multifield",
"xtype": "multifield",
"addLabel": "Add Item",
"fieldConfig": {
"xtype": "custommultifield",
"name": "./myCustomMultifield",
"fieldLabel": "My Custom Multifield"
}
}
Define the custom xtype: In your Content Fragment Model's client library, define the custom xtype for the inner multifield. For example:
CQ.Ext.define("myproject.CustomMultifield", {
extend: "CQ.form.MultiField",
constructor: function(config) {
config = config || {};
var defaults = {
"fieldConfig": {
"xtype": "textfield",
"name": "./myInnerTextField",
"fieldLabel": "My Inner Text Field"
}
};
config = CQ.Util.applyDefaults(config, defaults);
myproject.CustomMultifield.superclass.constructor.call(this, config);
}
});
Include the client library: In your Content Fragment Model's dialog, include the client library that defines the custom xtype. For example:
<cq:dialog
...
<cq:includeClientLib categories="myproject.custommultifield"/>
...
</cq:dialog>
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-conte...
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/multifield-in-content-frag...
Define the outer multifield: In your Content Fragment Model, define the outer multifield as you normally would.
{
"title": "My Multifield",
"name": "./myMultifield",
"fieldLabel": "My Multifield",
"xtype": "multifield",
"addLabel": "Add Item",
"fieldConfig": {
"xtype": "textfield",
"name": "./myTextField",
"fieldLabel": "My Text Field"
}
}
Define the inner multifield: In the fieldConfig
object of the outer multifield, define the inner multifield as a custom xtype. For example:
{
"title": "My Multifield",
"name": "./myMultifield",
"fieldLabel": "My Multifield",
"xtype": "multifield",
"addLabel": "Add Item",
"fieldConfig": {
"xtype": "custommultifield",
"name": "./myCustomMultifield",
"fieldLabel": "My Custom Multifield"
}
}
Define the custom xtype: In your Content Fragment Model's client library, define the custom xtype for the inner multifield. For example:
CQ.Ext.define("myproject.CustomMultifield", {
extend: "CQ.form.MultiField",
constructor: function(config) {
config = config || {};
var defaults = {
"fieldConfig": {
"xtype": "textfield",
"name": "./myInnerTextField",
"fieldLabel": "My Inner Text Field"
}
};
config = CQ.Util.applyDefaults(config, defaults);
myproject.CustomMultifield.superclass.constructor.call(this, config);
}
});
Include the client library: In your Content Fragment Model's dialog, include the client library that defines the custom xtype. For example:
<cq:dialog
...
<cq:includeClientLib categories="myproject.custommultifield"/>
...
</cq:dialog>
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/nested-multifield-in-conte...
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/multifield-in-content-frag...
@padmanabhsaoji Did you find the suggestion helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies