Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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

0 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.