Hi Guys,

I have created a modal with a comboboxedit which contains values from my webservice (attachments from opportunity linked to order). I want to change this into a List instead of a combobox.

In the following images you can see what I'm trying to aim.

 

Added button to open modal "Migrate Opp Files"

Here's the sample modal with a comboboxedit which shows result of my webservice. I want to change this into a List instead of a combobox.

The value of the dropdown comes from here.

I tried checking the documentation but I'm having a hard time since I'm a visual learner, I learn by seeing how things work in actually through examples.

Please guide me.

Best Regards,
Solem A.

Like 0

Like

2 comments
Best reply

Hi Oscar,

Just wanted to make sure my Post ends well.
I end up using LookUpUtilities to create my list pop-up.

Best Regards,
Solem A

Hello Solem,

 

It seems that it's not possible to add the list to the modal window since the parent entity for the modal window should be "Base entity page" while the list logic was developed in the BaseSectionV2 and related modules as ConfigurationGridGenerator and ConfigurationGrid. I performed a couple of tests and theoretically it's possible to add a list to a modal window, but it requires time to copy all the logic from the BaseSectionV2 and add it to the custom modal window. It's much easier to use a lookup instead.

 

Best regards,

Oscar

Hi Oscar,

Just wanted to make sure my Post ends well.
I end up using LookUpUtilities to create my list pop-up.

Best Regards,
Solem A

Show all comments

Hi,

I wanted to have a button on account page that can open a modal with iframe.

Button was done.
Code for modal was done as well.

I created the following.

(Module)

Ext.define("Terrasoft.controls.UsrIntegrateERPIframeControl", {
    extend: "Terrasoft.Component",
    alternateClassName: "Terrasoft.UsrIntegrateERPIframeControl",
    tpl: [
        '<iframe id="{id}" src="{src}" class="{wrapClass}"></iframe>'
    ],
    id: null,
    src: "https://academy.terrasoft.ru/",
    wrapClass: ["usr-iframe"],
    setIframeSrc: function(value) {
        value = value || "";
        if (this.src !== value) {
            this.src = value;
            this.safeRerender();
        }
    },
    init: function() {
        this.callParent(arguments);
        var selectors = this.selectors = this.selectors || {};
        selectors.wrapEl = selectors.wrapEl || "#" + this.id;
    },
    LoadPageBySrc: function() {
        var iframe = this.getWrapEl();
        iframe.dom.src = this.src;
    },
    onAfterRender: function() {
        this.callParent(arguments);
        this.LoadPageBySrc();
    },
    onAfterReRender: function() {
        this.callParent(arguments);
        this.LoadPageBySrc();
    },
    getBindConfig: function() {
        var bindConfig = this.callParent(arguments);
        return Ext.apply(bindConfig, {
            src: {
                changeMethod: "setIframeSrc"
            }
        });
    },
    getTplData: function() {
        var tplData = this.callParent(arguments);
        return Ext.apply(tplData, {
            src: this.src,
            wrapClass: this.wrapClass
        });
    }
});

(Page View Model)

define("UsrERPModalPage", ["UsrIntegrateERPIframeControl", "css!UsrIntegrateERPIframeControl"], function() {
    return {
        attributes: {
            "TestText": {
                dataValueType: Terrasoft.DataValueType.TEXT,
                type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN
            }
        },
        messages: {
        },
        methods: {
            init: function(callback, scope) {
                this.callParent(arguments);
            },
            getHeader: function() {
                return this.get("Resources.Strings.PageCaption");
            },
            onRender: function() {
                this.callParent(arguments);
                var moduleInfo = this.get("moduleInfo");
                var boxSizes = moduleInfo.modalBoxSize;
                var width = boxSizes.width;
                var height = boxSizes.height;
                this.updateSize(width, height);
            }
        },
        //Insert already existed Iframe
        diff: [
            {
                "operation": "insert",
                "parentName": "CardContentContainer",
                "propertyName": "items",
                "name": "UsrERPModalPage",
                "values": {
                    "generator": function() {
                        return {
                            "className": "Terrasoft.UsrIntegrateERPIframeControl"
                        };
                    }
                }
            },
            {
                "operation": "insert",
                "name": "MyContainer",
                "propertyName": "items",
                "values": {
                    "itemType": Terrasoft.ViewItemType.CONTAINER,
                    "items": []
                }
            },
            {
                "operation": "insert",
                "parentName": "MyContainer",
                "propertyName": "items",
                "name": "MyGridContainer",
                "values": {
                    "itemType": Terrasoft.ViewItemType.GRID_LAYOUT,
                    "items": []
                }
            },
            {
                "operation": "insert",
                "parentName": "MyGridContainer",
                "propertyName": "items",
                "name": "TestText",
                "values": {
                    "bindTo": "TestText",
                    "caption": "Test text",
                    "layout": {"column": 0, "row": 0, "colSpan": 10}
                }
            }
        ]
    };
});

(Replacing View Model )

define("AccountPageV2", ["AccountPageV2Resources", "MaskHelper"], function(MaskHelper) {
  return {
    entitySchemaName: "Account",
    methods: {     
      subscribeSandboxEvents: function() {
        this.callParent(arguments);
        this.sandbox.subscribe("GetModuleInfo", this.getGenerateQouteModalBoxConfig, this,
                               [this.getGenerateQouteModalBoxId()]);
 
      },
      getGenerateQouteModalBoxConfig: function() {
        return {
          "schemaName": "UsrERPModalPage",
          "modalBoxSize": {
            "width": "680px",
            "height": "400px"
          }
        };
      },
      getGenerateQouteModalBoxId: function() {
        return this.sandbox.id + "_GenerateQouteModalBox";
      },
      onGenerateQouteButtonClick: function() {
        this.sandbox.loadModule("ModalBoxSchemaModule", {
          id: this.getGenerateQouteModalBoxId()
        });
      }
    },
    diff: [   // Adding the button.
      {
        "operation": "insert",
        "parentName": "LeftContainer",
        "propertyName": "items",
        "name": "GenerateQouteSectionButton",
        "values": {
          itemType: Terrasoft.ViewItemType.BUTTON,
          caption: { bindTo: "Resources.Strings.OpenERPGenerateQouteButtonCaption" },
          click: { bindTo: "onGenerateQouteButtonClick" },
          style: Terrasoft.controls.ButtonEnums.style.BLUE    
        }
      },   
    ]
  };
});

Then I compiled (my package) but I got this error.

{ message: "Message GetModuleInfo is not defined in CardModuleV2 (SectionModuleV2_AccountSectionV2_CardModuleV2) module" }

Then I log-out, flush Redis, login again, compile all but still received the same error.

References:
https://community.creatio.com/articles/add-iframe-modalbox
https://community.creatio.com/questions/open-iframe-floating-page

Best Regards,
Solem

Like 0

Like

1 comments
Best reply

Hi Solem,

 

In the AccountPageV2 schema you do also need to create several messages were not mentioned in the original community post https://community.creatio.com/articles/add-iframe-modalbox since Excel report builder marketplace app was chosen as a page for an example where I think these messages are declared:

 

{
				"GetMasterEntitySchema": {
                        direction: Terrasoft.MessageDirectionType.SUBSCRIBE,
                        mode: Terrasoft.MessageMode.PTP
                                    },
     			 "UsrUploadFileClick": {
						direction: Terrasoft.MessageDirectionType.SUBSCRIBE,
                        mode: Terrasoft.MessageMode.PTP
                 },
          		"GetModuleInfo": {
                         direction: Terrasoft.MessageDirectionType.SUBSCRIBE,
                         mode: Terrasoft.MessageMode.PTP
                                    }
 
      },

As a result the button started to display the IFrame as needed:

Best regards,

Oscar

Hi Solem,

 

In the AccountPageV2 schema you do also need to create several messages were not mentioned in the original community post https://community.creatio.com/articles/add-iframe-modalbox since Excel report builder marketplace app was chosen as a page for an example where I think these messages are declared:

 

{
				"GetMasterEntitySchema": {
                        direction: Terrasoft.MessageDirectionType.SUBSCRIBE,
                        mode: Terrasoft.MessageMode.PTP
                                    },
     			 "UsrUploadFileClick": {
						direction: Terrasoft.MessageDirectionType.SUBSCRIBE,
                        mode: Terrasoft.MessageMode.PTP
                 },
          		"GetModuleInfo": {
                         direction: Terrasoft.MessageDirectionType.SUBSCRIBE,
                         mode: Terrasoft.MessageMode.PTP
                                    }
 
      },

As a result the button started to display the IFrame as needed:

Best regards,

Oscar

Show all comments