How to Fire Load Content from Custom Widget (ComboBox) | Community
Skip to main content
New Participant
October 16, 2015
Solved

How to Fire Load Content from Custom Widget (ComboBox)

  • October 16, 2015
  • 2 replies
  • 832 views

// 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 ? 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

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

2 replies

edubey
New Participant
October 16, 2015
Hi, Sorry, but I could not see loadContent above. Are you asking about loadContentInitial method? Thanks
smacdonald2008
smacdonald2008Accepted solution
New Participant
October 16, 2015

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