Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to Fire Load Content from Custom Widget (ComboBox)

Avatar

Level 4

// Link Style Start
            this.linkStyleField = new CQ.Ext.form.ComboBox({
                triggerAction : 'all',
                lazyRender : true,
                mode : 'local',
                width : 225,
                fieldLabel : 'Link Style',
                fieldDescription: "Select the CTA Style ",
                store : new CQ.Ext.data.ArrayStore({
                    id : 0,
                    fields : [ 'myId', 'displayText' ],
                    data : [ [ 'CTA', 'CTA' ],
                            [ 'IMAGE', 'IMAGE' ],[ 'CTA+Image', 'CTA+Image' ]]
                }),
                valueField : 'myId',
                displayField : 'displayText',
                value : 'CTA',
                listeners: {
                    change: {
                        scope:this,
                        fn:this.updateHidden
                    },

                    select: {
                        scope:this,
                        fn:this.loadContentVal
                    },

                     beforerender: { // Listener to Load earlier selected values and then hide / show other fields 
                        scope:this,
                        fn:this.loadContentInitial  // This gets loaded but can not access any dialog values , all values are undefined 
                    }
                },
            });
          this.add(this.linkStyleField);

 

Above is my code snippet for a custom Combo Box in a widget ... 

I want to fire up the function on loadContent for some manipulation , is above the right approach ? 

1 Accepted Solution

Avatar

Correct answer by
Level 10

Yes -- using the AEM Widget API to work with events is the correct way. 

View solution in original post

2 Replies

Avatar

Level 10
Hi, Sorry, but I could not see loadContent above. Are you asking about loadContentInitial method? Thanks

Avatar

Correct answer by
Level 10

Yes -- using the AEM Widget API to work with events is the correct way.