Expand my Community achievements bar.

SOLVED

Nested multifield for components

Avatar

Level 5

Hi All,

I am using custom xtype making 3 textfield as multifield. Data saved under content node is 

{"groupId" : "1", "groupName" : "Manager", "groupInformation" : "Managers"}

Now, under one textfield I want another multifield for two text field so output should be 

{"groupId" : "1", "groupName" : "Manager", "groupInformation" : {"roleType" : "Managers", "rolechange" : "associate"} }

I am returning data in above format from my extjs file and want to achieve result in return function in extjs only.

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 10

You get values that an author enters into a nested multifield using JSP code. 

This is all explained in this article: 

Creating Adobe Experience Manager Components that use Nested Multifields

Hope this helps 

View solution in original post

5 Replies

Avatar

Level 10

Hi, 

Can you elaborate want to achieve result in return function in extjs only.

Thanks

Avatar

Level 5

Hi,

I am able to create nested multifeld in dialog

by adding something like

//define the inner multifield
        this.userData = new CQ.form.MultiField({
            fieldLabel: "User Data",
            fieldDescription: "Click '+' to add your Skills",
            width: 400,
            fieldConfig: {
                  "xtype": "customtextPathField",
                  allowBlank: false,
            },

              listeners: {
                  change: {
                        scope: this,
                        fn: this.updateHidden
                    }
                }
            });
            this.add(this.userData);

 

But how to get and set values of "user Data in extjs" ?

Avatar

Correct answer by
Level 10

You get values that an author enters into a nested multifield using JSP code. 

This is all explained in this article: 

Creating Adobe Experience Manager Components that use Nested Multifields

Hope this helps 

Avatar

Level 5

Hi smacdonald2008,

I already tried this link but not working for me.

In above code I am referring to external extjs and trying to set values in my current extjs like

setValue: function(value) {

        var link = JSON.parse(value);
        this.groupId.setValue(link.groupId);
        this.groupName.setValue(link.groupName);
        this.displayName.setValue(link.displayName);
        this.workerTypeID.setValue(link.workerTypeID);        /// Values are coming undefined
        this.workerTypeName.setValue(link.workerTypeName);    
 /// Values are coming undefined
        this.hiddenField.setValue(value);
    },

I am looking for a way to reterive these values and set like the structure mention above in my previous post.

 

Thanks