Forum Discussion

Sathish's avatar
Sathish
Ideator I
2 years ago
Solved

Is it Possible to pass custom parameters from a javascript to Search dialog

I'm attempting to apply a custom filter value to a search dialog in my application. To achieve this, I'm using the 'onSearchdialog' event on a specific property where the filter should be applied. However, I've encountered an issue where the filter value is not accessible within the 'onSearchdialog' method. This filter value needs to be dynamically set based on the selection made in a dropdown within a custom form. How can I pass this dynamic filter value to the 'onSearchdialog' method from an external JavaScript file that opens the search dialog?

  • You can use the itemContext property of the search dialog parameters. The type of the itemContext is Node, you can set it properties or attributes and it will be passed to onSearchDialog method as inArgs.itemContext.

3 Replies

  • Is your custom form a some item form or a custom dialog? The dropdown is some item property or just list of values?

    • Sathish's avatar
      Sathish
      Ideator I

      The custom form is a standard HTML page and not a dialog. 

      Then in the HTML page, from where i open the searchdialog, below code is used[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef7092b-3234-478d-939a-ce8f57a5282b:type=javascript&text=async%20_openSearchDialog%28%29%20%7B%0A%09%09const%20returnValue%20%3D%0A%09%09%09await%20this._topWindow.ArasModules.MaximazableDialog.show%28%27iframe%27%2C%20%7B%0A%09%09%09%09aras%3A%20this._aras%2C%0A%09%09%09%09itemtypeName%3A%20this._selectionSetItemType%2C%0A%09%09%09%09type%3A%20%27SearchDialog%27%2C%0A%09%09%09%09sourceItemTypeName%3A%20%27vm_SelectionSet%27%2C%0A%09%09%09%09sourcePropertyName%3A%20%27custom_variabilityitem%27%2C%0A%09%09%09%09parameter1%3A%20%27%25variability1%25%27%0A%09%09%09%7D%29.promise%3B%0A%0A%09%09return%20returnValue%3B%0A%09%7D]

      I write the below code in onSearchDialog event of the property. I want to use the parameter1 value in the 'onSearchdialog' event.

      [embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:c4014cff-d5c5-4afb-84c6-88a71ec3c2d6:type=javascript&text=var%20customParam%20%3D%20inArgs.parameter1%3B%0Avar%20Filter%20%3D%20%7B%7D%3B%0AFilter%5B%22dvl_variabilityitem%22%5D%20%3D%20%7B%20filterValue%3A%20customParam%2C%20isFilterFixed%3A%20false%20%7D%3B%0Areturn%20Filter%3B%0A]

      • alaxala's avatar
        alaxala
        Ideator I

        You can use the itemContext property of the search dialog parameters. The type of the itemContext is Node, you can set it properties or attributes and it will be passed to onSearchDialog method as inArgs.itemContext.