How to extend sling postservlet in aem for ok button in dialog.

save : function() {
            var config = {
                url: 'path to servlet',
               ,success: function(){
                    CQ.Ext.Msg.show({
                        title : CQ.I18n.getMessage('Success'),
                        msg : CQ.I18n.getMessage('successfully .'),
                        buttons : CQ.Ext.Msg.OK,
                        icon : CQ.Ext.Msg.INFO
                    });
                },failure: function(){
                    CQ.Ext.Msg.show({
                        title : CQ.I18n.getMessage('Error'),
                        msg : CQ.I18n.getMessage('Save failed, check logs.'),
                        buttons : CQ.Ext.Msg.OK,
                        icon : CQ.Ext.Msg.ERROR
                    });
                }
            };

constructor : function(config) {
                      
             config = CQ.Util.applyDefaults(config, {
                resizable : false,
                float : false,
                draggable : false,
                minimizable : false,
                closable : false,
                plain : true,
                layout : "form",
                hidden : false,
                padding : "20px",
                style : {
                    position : "inherit",
                    zIndex : "auto",
                    left : '0px',
                    top : '0px'
                },
                x : 0,
                y : 0,
                defaults : {
                    layout : "form"
                },
              
                disabled: this.readOnly,
               formUrl : url,
                responseScope : this,
                buttons : [ {
                    text : "Save",
                    handler : this.save,
                    scope : this
                } ],
                buttonAlign: "right"
            });

Comments

Popular posts from this blog

AEM 6.3 Migration -osgi bundle whitelist error-osgi-service is NOT whitelisted to use SlingRepository.loginAdministrative

CQ/AEM Quick Bits