How to open new section from Button OnClickAction

Hello team ,

if i click on button it will redirect to another section or page 

could you please help me with this code 

please  reply soon

regards ,

uttej

Like 0

Like

1 comments

In order to open another section or page please use the code below:

this.sandbox.publish("PushHistoryState", {hash: "SectionModuleV2/AccountSectionV2/"});

The "hash" parameter is what appears after the ViewModule.aspx# in the url.

Here is an example below. In the example the Account section is opened when "Open Account Section" button is clicked.

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

    return {

        entitySchemaName: "Contact",

        methods: {

            onOpenAccountSectionClick: function(){

                 this.sandbox.publish("PushHistoryState", {hash: "SectionModuleV2/AccountSectionV2/"});

            }

        },

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

        diff: /**SCHEMA_DIFF*/[

             {

                    // Indicates that an operation of adding an item to the page is being executed.

                    "operation": "insert",

                    // Meta-name of the parent control item where the button is added.

                    "parentName": "LeftContainer",

                    // Indicates that the button is added to the control items collection

                    // of the parent item (whose name is specified in the parentName).

                    "propertyName": "items",

                    // Meta-name of the added button.

                    "name": "OpenSecrionButton",

                    // Supplementary properties of the item.

                    "values": {

                        // Type of the added item is button.

                        itemType: Terrasoft.ViewItemType.BUTTON,

                        // Binding the button title to a localizable string of the schema.

                        caption: {bindTo: "Resources.Strings.OpenAccountSection"},

                        // Binding the button press handler method.

                        click: { bindTo: "onOpenAccountSectionClick" },

                        enabled: true,

                        // Setting the field location.

                        "layout": {

                            "column": 1,

                            "row": 6,

                            "colSpan": 1

                        }

                    }

                }

    

        ]/**SCHEMA_DIFF*/

    };

});

 

 

 

Show all comments