<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.aras.com/community/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Don&amp;#039;t close the searchdialog</title><link>https://www.aras.com/community/f/development/3451/don-t-close-the-searchdialog</link><description>How can I do when I open the item searchdialog and doubleclick, do not close the searchdialog?</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Don't close the searchdialog</title><link>https://www.aras.com/community/thread/1016?ContentTypeID=1</link><pubDate>Thu, 16 Nov 2017 15:36:26 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:bd2f9fb6-33e0-423f-ba33-46ad156994dd</guid><dc:creator>Christopher Gillis</dc:creator><description>Hello,

It doesn&amp;#39;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 &amp;quot;filter&amp;quot; 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.

&lt;pre&gt;&lt;code&gt;var Filter = {};
Filter[&amp;quot;state&amp;quot;] = { filterValue: &amp;quot;Released&amp;quot;, isFilterFixed: true };
// Set up parameters for search dialog
var param = {
    aras: top.aras,
    content: &amp;#039;SearchDialogWithFilter.html&amp;#039;, // &amp;lt;-- Use &amp;quot;content&amp;quot; rather than &amp;quot;type&amp;quot; to point to a specific .html page  
    dialogWidth: 700,
    dialogHeight: 450,
    itemtypeName: &amp;#039;Part&amp;#039;,
    multiselect: true,
    handler: addRelationshipHandler,
    sourceItemTypeName: &amp;quot;Part&amp;quot;,
    sourcePropertyName: &amp;quot;dummytrigger&amp;quot;,
    myCustomFilterParam: Filter // &amp;lt;-- Pass in the filter parameter that you&amp;#039;ve added to your custom SearchDialog
};&lt;/code&gt;&lt;/pre&gt;


Chris

___________________________________

Christopher Gillis

Aras Labs Software Engineer&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Don't close the searchdialog</title><link>https://www.aras.com/community/thread/1000?ContentTypeID=1</link><pubDate>Mon, 13 Nov 2017 01:08:31 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:42294cb5-1df6-4ad8-8518-5dfcf70966f6</guid><dc:creator>Former Member</dc:creator><description>Hi Chris,

It&amp;#39;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: &amp;#39;SearchDialog&amp;#39;,

dialogWidth: 700,

dialogHeight: 450,

itemtypeName: &amp;#39;Part&amp;#39;,

multiselect: true,

handler: addRelationshipHandler,

sourceItemTypeName: &amp;quot;Part&amp;quot;, // &amp;lt;-- The name of your ItemType

sourcePropertyName: &amp;quot;dummyForFilter&amp;quot; // &amp;lt;-- The name of your dummy property

&lt;em&gt;&lt;strong&gt;myparameter:test&lt;/strong&gt;&lt;/em&gt;};

&amp;nbsp;

onSearchdilog:

var param= this.getProperty(&amp;quot;myparameter&amp;quot;);

var Filter = {};
Filter["_setting_type"] = {filterValue:&amp;quot;param&amp;quot;,isFilterFixed:true};

return Filter;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Don't close the searchdialog</title><link>https://www.aras.com/community/thread/998?ContentTypeID=1</link><pubDate>Fri, 10 Nov 2017 09:48:33 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:c6ef0f88-1a4e-49ef-b585-3ab6372646ee</guid><dc:creator>Christopher Gillis</dc:creator><description>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.

&amp;lt;script src=&amp;quot;&lt;a href="https://gist.github.com/cgillis-aras/76a2acc0aa326ab0fade0dcbb768ae8d.js"&gt;&amp;quot;&amp;gt;gist.github.com/.../script&amp;gt;&lt;/a&gt;

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 &amp;quot;dummy&amp;quot; property that will hold the filter for this search dialog.
&lt;ol&gt;
 	&lt;li&gt;Create a &amp;quot;dummy&amp;quot; property on the ItemType that is calling the search dialog with the following information
&lt;ol&gt;
 	&lt;li&gt;Name: dummyForFilter&lt;/li&gt;
 	&lt;li&gt;Type: String&lt;/li&gt;
 	&lt;li&gt;Length: 1&lt;/li&gt;
 	&lt;li&gt;Hidden1: true&lt;/li&gt;
 	&lt;li&gt;Hidden2: true&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
 	&lt;li&gt;Right-click on this new Property and select &amp;quot;View Properties&amp;quot;&lt;/li&gt;
 	&lt;li&gt; Create a Method with the filter code above and add it as an &amp;quot;&lt;strong&gt;onSearchDialog&lt;/strong&gt;&amp;quot; event to this property&lt;/li&gt;
 	&lt;li&gt;Save, unlock, and close both the Property and the ItemType&lt;/li&gt;
&lt;/ol&gt;
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 &lt;strong&gt;sourceItemType&lt;/strong&gt;&lt;strong&gt;Name&lt;/strong&gt; and &lt;strong&gt;sourcePropertyName&lt;/strong&gt; parameters as seen in the sample below.

&lt;pre&gt;&lt;code&gt;var param = {
aras: top.aras,
type: &amp;#039;SearchDialog&amp;#039;,
dialogWidth: 700,
dialogHeight: 450,
itemtypeName: &amp;#039;Part&amp;#039;,
multiselect: true,
handler: addRelationshipHandler,
sourceItemTypeName: &amp;quot;Part&amp;quot;, // &amp;lt;-- The name of your ItemType
sourcePropertyName: &amp;quot;dummyForFilter&amp;quot; // &amp;lt;-- The name of your dummy property
};&lt;/code&gt;&lt;/pre&gt;


Following this example, you will see that the &amp;quot;state&amp;quot; column of the resulting search dialog now auto-populates with a value of &amp;quot;Released&amp;quot; and cannot be changed.

Chris

_______________________________

Christopher Gillis

Aras Labs Software Engineer&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Don't close the searchdialog</title><link>https://www.aras.com/community/thread/996?ContentTypeID=1</link><pubDate>Fri, 10 Nov 2017 00:36:03 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:ac76bb1c-fc37-4db3-b18a-4c19ac05f42d</guid><dc:creator>Former Member</dc:creator><description>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.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Don't close the searchdialog</title><link>https://www.aras.com/community/thread/994?ContentTypeID=1</link><pubDate>Thu, 09 Nov 2017 21:43:23 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:393c74cd-09eb-4d26-85a3-c915a73c6580</guid><dc:creator>Former Member</dc:creator><description>Hi Chris,

Thank you for your assistance in resolving my long-awaited question.

^^&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Don't close the searchdialog</title><link>https://www.aras.com/community/thread/988?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2017 10:18:15 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:11076e5f-9e9c-4053-9486-71d2991fa6ea</guid><dc:creator>Christopher Gillis</dc:creator><description>Hello,

It sounds like you are calling this dialog directly from a custom method. If that&amp;#39;s the case, you can pass in a &amp;quot;handler&amp;quot; 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&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Don't close the searchdialog</title><link>https://www.aras.com/community/thread/985?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2017 21:34:19 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:9db16185-aa4f-4b79-beb7-18a25f4fa75a</guid><dc:creator>Former Member</dc:creator><description>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.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Don't close the searchdialog</title><link>https://www.aras.com/community/thread/982?ContentTypeID=1</link><pubDate>Tue, 07 Nov 2017 10:57:12 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:1f85f42b-606c-40b6-8bb0-d2d221f428fa</guid><dc:creator>Christopher Gillis</dc:creator><description>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&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>