<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [select2] Filter the values of widget &amp;quot;Single Directory Suggestion&amp;quot; in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/select2-filter-the-values-of-widget-quot-single-directory/m-p/327534#M14535</link>
    <description>&lt;P&gt;&lt;A href="http://www.nuxeo.com/blog/fun-suggestion-widget-javascript/"&gt;This blog post &lt;/A&gt; shows how to use an Automation Script to filter suggestion results.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Oct 2015 13:36:32 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-10-29T13:36:32Z</dc:date>
    <item>
      <title>[select2] Filter the values of widget "Single Directory Suggestion"</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/select2-filter-the-values-of-widget-quot-single-directory/m-p/327531#M14532</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I wish to filter dynamically the results returned by the widget "&lt;STRONG&gt;single directory suggestion&lt;/STRONG&gt;" using javascript select2 class.&lt;/P&gt;
&lt;P&gt;I saw in your tutorial we could use "&lt;STRONG&gt;inline javascript&lt;/STRONG&gt;" expressions called by "&lt;STRONG&gt;Formatter Suggestion&lt;/STRONG&gt;" or "&lt;STRONG&gt;Selection Formatter&lt;/STRONG&gt;".
I want to be filtered through a metadata parameter data.&lt;/P&gt;
&lt;P&gt;The Nuxeo documentation is insufficient on this subject.
I can not use it properly.&lt;/P&gt;
&lt;P&gt;I would have as a result:&lt;/P&gt;
&lt;P&gt;before:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="type a image title"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/1978iC29592E23946796C/image-size/large?v=v2&amp;amp;px=999" role="button" title="type a image title" alt="type a image title" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;after:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="type a image title"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/1977i176AA412156C03E6/image-size/large?v=v2&amp;amp;px=999" role="button" title="type a image title" alt="type a image title" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Can we do this stuff?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2015 12:12:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/select2-filter-the-values-of-widget-quot-single-directory/m-p/327531#M14532</guid>
      <dc:creator>Pierre_Jenicot1</dc:creator>
      <dc:date>2015-07-09T12:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: [select2] Filter the values of widget "Single Directory Suggestion"</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/select2-filter-the-values-of-widget-quot-single-directory/m-p/327532#M14533</link>
      <description>&lt;P&gt;First we need to create a Schema and we need to get its entries in database. Then the values that you want to show in dropdown should be written in some csv file and load it through directories-contrib.xml.&lt;/P&gt;
&lt;P&gt;Declare your schema in core-contrib.xml like&lt;/P&gt;
&lt;P&gt;&lt;SCHEMA name="FolderTypes" prefix="medicalscholarlyarticle" src="https://connect.hyland.com/schema/folder_types.xsd"&gt;&lt;/SCHEMA&gt;&lt;/P&gt;
&lt;P&gt;Define your schema somewhat like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;xs:element name="id" type="xs:string"/&amp;gt;
&amp;lt;xs:element name="label_en" type="xs:string"/&amp;gt;
&amp;lt;xs:element name="obsolete" type="xs:integer" default="0"/&amp;gt;
&amp;lt;xs:element name="ordering" type="xs:integer" default="10000000"/&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and directories-contrib.xml will look like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;directory name="folder_types"&amp;gt;
  &amp;lt;schema&amp;gt;your_schema&amp;lt;/schema&amp;gt;
  &amp;lt;dataSource&amp;gt;java:/nxsqldirectory&amp;lt;/dataSource&amp;gt;
  &amp;lt;cacheTimeout&amp;gt;3600&amp;lt;/cacheTimeout&amp;gt;
  &amp;lt;cacheMaxSize&amp;gt;1000&amp;lt;/cacheMaxSize&amp;gt;
  &amp;lt;table&amp;gt;table_name_in_DB&amp;lt;/table&amp;gt;
  &amp;lt;idField&amp;gt;id&amp;lt;/idField&amp;gt;
  &amp;lt;autoincrementIdField&amp;gt;false&amp;lt;/autoincrementIdField&amp;gt;
  &amp;lt;dataFile&amp;gt;directories/your_csv_file.csv&amp;lt;/dataFile&amp;gt;
  &amp;lt;createTablePolicy&amp;gt;always&amp;lt;/createTablePolicy&amp;gt;
&amp;lt;/directory&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
  
&lt;P&gt;This one worked for me. Hope it resolves your problem.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 11:57:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/select2-filter-the-values-of-widget-quot-single-directory/m-p/327532#M14533</guid>
      <dc:creator>Pradeep_Bhat</dc:creator>
      <dc:date>2015-10-29T11:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: [select2] Filter the values of widget "Single Directory Suggestion"</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/select2-filter-the-values-of-widget-quot-single-directory/m-p/327533#M14534</link>
      <description>&lt;P&gt;The “Formatter Suggestion” or “Selection Formatter“ are only to format the diplayed entries and won't do any filtering.&lt;/P&gt;
&lt;P&gt;I am not sure to understand which kind of filtering you'd like to achieve but just know that the underlying automation operation that returns the suggestions is&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/nuxeo/nuxeo/blob/master/nuxeo-features/nuxeo-platform-ui-select2/src/main/java/org/nuxeo/ecm/platform/ui/select2/automation/SuggestDirectoryEntries.java"&gt;SuggestDirectoryEntries.java&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You might want to write your own opeartion based on it and use it by specifying its operation id to the select2 widget.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;operationId=YouSuggestOperation
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Oct 2015 12:57:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/select2-filter-the-values-of-widget-quot-single-directory/m-p/327533#M14534</guid>
      <dc:creator>Guillaume_Renar</dc:creator>
      <dc:date>2015-10-29T12:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: [select2] Filter the values of widget "Single Directory Suggestion"</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/select2-filter-the-values-of-widget-quot-single-directory/m-p/327534#M14535</link>
      <description>&lt;P&gt;&lt;A href="http://www.nuxeo.com/blog/fun-suggestion-widget-javascript/"&gt;This blog post &lt;/A&gt; shows how to use an Automation Script to filter suggestion results.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 13:36:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/select2-filter-the-values-of-widget-quot-single-directory/m-p/327534#M14535</guid>
      <dc:creator />
      <dc:date>2015-10-29T13:36:32Z</dc:date>
    </item>
  </channel>
</rss>

