I have some lookup fields that I want to ensure do not display the usual 'New' or 'Actions' buttons when the pop-up modal box appears:

Is there a way to do this via the normal schema diff section on a page?  I'm aware of options as shown on the EmailPageV2 that show a values -> controlConfig section, binding an onClick() event to a callback function:

             {

                "operation": "insert",

                "parentName": "Header",

                "propertyName": "items",

                "name": "Recepient",

                "values": {

                    "bindTo": "Recepient",

                    "layout": {

                        "column": 0,

                        "row": 1,

                        "colSpan": 22

                    },

                    "controlConfig": {

                        "className": "Terrasoft.TextEdit",

                        "rightIconClasses": ["custom-right-item", "lookup-edit-right-icon"],

                        "rightIconClick": {

                            "bindTo": "openRecepientLookupEmail"

                        }

                    },

                    "enabled": {

                        "bindTo": "isEmailSendStatusNotSent"

                    }

                }

            },

.......

            /**
             * Shows select recepients lookup window.
             * @protected
             */
            openRecepientLookupEmail: function(searchValue, columnName) {
                var lookup = this.getLookupConfig(columnName || "Recepient");
                lookup.config.actionsButtonVisible = false;
                LookupUtilities.Open(this.sandbox, lookup.config, lookup.callback, this, null, false, false);
            }



which by setting the config element actionsButtonVisible to false appears to achieve what I need, but it does require setting up additional text fields, and mixing in the LookupUtilities module.

 

Is it possible to pass that in inside the controlConfig block? 

ie

                    "controlConfig": {
                            "actionButtonVisible": false,
                        }

or should it be

                    "controlConfig": {
                        "lookupConfig": {"actionsButtonVisibl": false}
                    }

 

Thanks,

 

Lachlan Devantier

Like 0

Like

3 comments

So it turns out there is the option of a CSS "hack" to hide them:



.ts-modalbox {

    span[data-tag=add],span[data-tag=ActionButton] {

        display: none;

    }

}

But it would be nice to know if there was a consistent way to tell the form control to simply omit them when it was constructing it's DOM elements, rather than relying on the browser to hide them after the fact.

 

Lachlan Devantier,

It's possible to hide the "New" and "Actions" buttons on the lookup modalbox by configuring an attribute. Please set the "hideActions" property to "true" in the "lookupListConfig" object for that. Here is an example for the "Owner" lookup field on the Contract page below:

define("ContractPageV2", [], function() {

    return {

        entitySchemaName: "Contract",

        attributes: {

            "Owner": {

                    dataValueType: this.Terrasoft.DataValueType.LOOKUP,

                    lookupListConfig: {

                        hideActions: true

                    }

                }

        },

        modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,

        details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,

        businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,

        methods: {},

        dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,

        diff: /**SCHEMA_DIFF*/[

        

        ]/**SCHEMA_DIFF*/

    };

});

 

Alina Kazmirchuk,

Thanks for that, it works like a charm. 

For anyone in the bpm'online/creatio academy documentation team reading this, this is exactly the kind of information we need to know on pages like https://academy.creatio.com/documents/technic-sdk/7-15/modal-windows

If you have a consistent set of control attributes/flags that can be applied, then they should be documented clearly on the academy site with examples.

Show all comments