Don't close the searchdialog

How can I do when I open the item searchdialog and doubleclick, do not close the searchdialog?
  • Hello, Could you please clarify your use case? Typically, double clicking a search dialog will only close the dialog when one item is expected to be returned such as an item property. If the search dialog can return multiple results such as when adding relationships to the relationship grid, double clicking will not close the search dialog. Chris ______________________________________________ Christopher Gillis Aras Labs Software Engineer
  • Hi Chris, Because I have customized needs,I use the item dialog change to multiple select.(ex:I want to select multiple Identity no use relationship.) When I click the item, it will set value to another field. So, when I open the item searchdialog and doubleclick, do not close the searchdialog. Thanks.
  • Hello, It sounds like you are calling this dialog directly from a custom method. If that's the case, you can pass in a "handler" function as a parameter that can be used to override the default behavior of a click or doubleclick. Please see an example of this below. Chris ________________________________________________ Christopher Gillis Aras Labs Software Engineer
  • Hi Chris, Thank you for your assistance in resolving my long-awaited question. ^^
  • Hi Chris, Sorry, I have another question. If I want to add default criteria to the search dialog when open the search dialog . What can I do? Thanks.
  • Hello, It is possible to set a filter from an onSearchDialog event on the Property that opens the dialog using code like the sample below. <script src="">gist.github.com/.../script> However, since you are opening this dialog from a method instead of directly from a property, you will need to follow the steps below to add a "dummy" property that will hold the filter for this search dialog.
    1. Create a "dummy" property on the ItemType that is calling the search dialog with the following information
      1. Name: dummyForFilter
      2. Type: String
      3. Length: 1
      4. Hidden1: true
      5. Hidden2: true
    2. Right-click on this new Property and select "View Properties"
    3.  Create a Method with the filter code above and add it as an "onSearchDialog" event to this property
    4. Save, unlock, and close both the Property and the ItemType
    After adding this filter, you will need to modify the method that opens the search dialog to pass in this dummy property as a parameter using the sourceItemTypeName and sourcePropertyName parameters as seen in the sample below.
    var param = {
    aras: top.aras,
    type: 'SearchDialog',
    dialogWidth: 700,
    dialogHeight: 450,
    itemtypeName: 'Part',
    multiselect: true,
    handler: addRelationshipHandler,
    sourceItemTypeName: "Part", // <-- The name of your ItemType
    sourcePropertyName: "dummyForFilter" // <-- The name of your dummy property
    };
    Following this example, you will see that the "state" column of the resulting search dialog now auto-populates with a value of "Released" and cannot be changed. Chris _______________________________ Christopher Gillis Aras Labs Software Engineer
  • Hi Chris, It's work. But the filter method by different parameter. Can I send self parameter to the searchdialog? Thanks. Ex: var param = { aras: top.aras, type: 'SearchDialog', dialogWidth: 700, dialogHeight: 450, itemtypeName: 'Part', multiselect: true, handler: addRelationshipHandler, sourceItemTypeName: "Part", // <-- The name of your ItemType sourcePropertyName: "dummyForFilter" // <-- The name of your dummy property myparameter:test};   onSearchdilog: var param= this.getProperty("myparameter"); var Filter = {}; Filter["_setting_type"] = {filterValue:"param",isFilterFixed:true}; return Filter;
  • Hello, It doesn't appear possible to access the parameters passed to the Search Dialog through the method that applies the filter. That being said, it may be possible to create a copy of the SearchDialog.html file in the code tree and modify that copy to accept an additional "filter" parameter. We do not have any samples of customizing the SearchDialog in this way, but you can modify your method based on the sample below to call your custom Search Dialog.
    var Filter = {};
    Filter["state"] = { filterValue: "Released", isFilterFixed: true };
    // Set up parameters for search dialog
    var param = {
        aras: top.aras,
        content: 'SearchDialogWithFilter.html', // <-- Use "content" rather than "type" to point to a specific .html page  
        dialogWidth: 700,
        dialogHeight: 450,
        itemtypeName: 'Part',
        multiselect: true,
        handler: addRelationshipHandler,
        sourceItemTypeName: "Part",
        sourcePropertyName: "dummytrigger",
        myCustomFilterParam: Filter // <-- Pass in the filter parameter that you've added to your custom SearchDialog
    };
    Chris ___________________________________ Christopher Gillis Aras Labs Software Engineer