<p style="margin:0;padding:0;" align="left">Hi everybody,<br /><br /><br />I would like to make possible to my cartoweb user to do different searches:<br />- search by road names.<br />- search by town names.<br />- ...<br /><br />They are independant searches which use completely different tables of my database.<br /><br />The searches work well when I put only one at a time in my project. But when I try to propose different searches, only one of them is working.<br /><br /><br />Here is what I did :<br /><br /><font color="#ff0000">search.ini file:</font><br /><br />dsn = pgsql://postgres:mypassword@localhost:5432/mydb<br /><br />encodingContext = myEncoding <br /><br /><br />config.route_fusion.provider.type = fulltextTable<br />config.route_fusion.provider.table = route_fusion<br />config.route_fusion.provider.id = gid<br />config.route_fusion.provider.columns = gid, data, reso01<br />config.route_fusion.provider.fulltextColumns = data<br />config.route_fusion.provider.sortColumn = gid<br />config.route_fusion.provider.sortDirection = asc<br />config.route_fusion.formatter.type = smarty<br />config.route_fusion.formatter.template = search_results<br /><br /><br />config.pr.provider.type = fulltextTable<br />config.pr.provider.table = pr<br />config.pr.provider.id = gid<br />config.pr.provider.columns = gid, route, prd<br />config.pr.provider.fulltextColumns = route<br />config.pr.provider.sortColumn = gid<br />config.pr.provider.sortDirection = asc<br />config.pr.formatter.type = smarty<br />config.pr.formatter.template = search_results<br /><br /><br /><font color="#ff0000">search.ajax.js file:</font><br /><br />AjaxPlugins.Search = {<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; handleResponse: function(pluginOutput) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /><br />if (pluginOutput.htmlCode.route_fusion) {<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; var targetElm = $('search_results_div');<br />&nbsp;&nbsp;&nbsp; if (targetElm) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert('element trouve!');<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; targetElm.innerHTML = pluginOutput.htmlCode.route_fusion;<br />&nbsp;&nbsp;&nbsp; } else {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert('element non trouve');<br />&nbsp;&nbsp;&nbsp; }<br />} <br /><br />if (pluginOutput.htmlCode.pr) {<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; var targetElm = $('search_results_div');<br />&nbsp;&nbsp;&nbsp; if (targetElm) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert('element trouve!');<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; targetElm.innerHTML = pluginOutput.htmlCode.pr;<br />&nbsp;&nbsp;&nbsp; } else {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert('element non trouve');<br />&nbsp;&nbsp;&nbsp; }<br />}<br /><br />else {<br />&nbsp;&nbsp;&nbsp; alert('l element recherche n existe pas!');<br />}<br /><br />&nbsp;&nbsp;&nbsp; }&nbsp; <br />};<br /><br /><br />/*<br />&nbsp;* Search plugin's Actions<br />&nbsp;*/<br />&nbsp;<br />AjaxPlugins.Search.Actions = {};<br /><br />AjaxPlugins.Search.Actions.DoIt = {<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; buildPostRequest: function(argObject) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return AjaxHandler.buildPostRequest();<br />&nbsp;&nbsp;&nbsp; }<br />};<br /><br />function order(column) {<br /><br />&nbsp;&nbsp;&nbsp; if (column != $('search_sort_column').value) {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $('search_sort_column').value = column;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $('search_sort_direction').value = 'asc';<br />&nbsp;&nbsp;&nbsp; } else {<br />&nbsp;&nbsp;&nbsp; if ($('search_sort_direction').value == 'asc') {<br />&nbsp;&nbsp;&nbsp; $('search_sort_direction').value = 'desc';<br />&nbsp;&nbsp;&nbsp; } else {<br />&nbsp;&nbsp;&nbsp; $('search_sort_direction').value = 'asc';<br />&nbsp;&nbsp;&nbsp; }<br />}<br />CartoWeb.trigger('Search.DoIt')<br />}<br /><br /><br /><br /><br />function recenter(id) {<br /><br />&nbsp;&nbsp;&nbsp; if ($('search_config').value == 'route_fusion'){<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $('id_recenter_ids').value = id;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $('id_recenter_layer').value = $('search_config').value; <br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; CartoWeb.trigger('Location.Recenter');<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; if ($('search_config').value == 'pr'){<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $('id_recenter_ids').value = id;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $('id_recenter_layer').value = $('search_config').value; <br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; CartoWeb.trigger('Location.Recenter');<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; <br />}<br /><br /><font color="#ff0000">search.tpl file:</font><br /><br />&lt;div id=&quot;search_div&quot;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;fieldset&gt;&lt;legend&gt;{t}Recherche par nom de route{/t}&lt;/legend&gt; &lt;br/&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;table width=&quot;100%&quot;&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {t}Nom de la route : {/t}<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/td&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;input type=&quot;text&quot; id=&quot;search_data&quot;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; name=&quot;search_data&quot; size =&quot;13&quot;&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/td&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/table&gt;<br />&lt;p&gt;<br />&nbsp; &lt;input type=&quot;submit&quot; value=&quot;{t}Search{/t}&quot; class=&quot;form_button&quot;<br />&nbsp; onclick=&quot;javascript: CartoWeb.trigger('Search.DoIt'); return false;&quot;/&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <br />&nbsp; &lt;input type=&quot;hidden&quot; id=&quot;search_config&quot; name=&quot;search_config&quot; value=&quot;route_fusion&quot;/&gt;<br />&nbsp; &lt;input type=&quot;hidden&quot; id=&quot;search_sort_column&quot; name=&quot;search_sort_column&quot; value=&quot;data&quot;/&gt;<br />&nbsp; &lt;input type=&quot;hidden&quot; id=&quot;id_recenter_ids&quot; name=&quot;id_recenter_ids&quot;/&gt;<br />&nbsp; &lt;input type=&quot;hidden&quot; id=&quot;id_recenter_layer&quot; name=&quot;id_recenter_layer&quot;/&gt;<br />&nbsp; &lt;input type=&quot;hidden&quot; id=&quot;search_sort_direction&quot; name=&quot;search_sort_direction&quot; value=&quot;asc&quot;/&gt;<br />&nbsp; &lt;input type=&quot;hidden&quot; id=&quot;search_number&quot; name=&quot;search_number&quot; /&gt;<br /><br />&nbsp;<br />&nbsp;&nbsp;&nbsp; &lt;div id=&quot;search_results_div&quot;&gt;&lt;/div&gt;<br />&lt;/p&gt;<br />&lt;/fieldset&gt;<br />&lt;/div&gt;<br /><br />&lt;div id=&quot;search_div&quot;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;fieldset&gt;&lt;legend&gt;{t}Recherche par nom de route et pr{/t}&lt;/legend&gt; &lt;br/&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;table width=&quot;100%&quot;&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {t}Nom de la route : {/t}<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/td&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;input type=&quot;text&quot; id=&quot;search_route&quot;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; name=&quot;search_route&quot; size =&quot;13&quot;&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/td&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/table&gt;<br />&lt;p&gt;<br />&nbsp; &lt;input type=&quot;submit&quot; value=&quot;{t}Search{/t}&quot; class=&quot;form_button&quot;<br />&nbsp; onclick=&quot;javascript: CartoWeb.trigger('Search.DoIt'); return false;&quot;/&gt;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <br />&nbsp; &lt;input type=&quot;hidden&quot; id=&quot;search_config&quot; name=&quot;search_config&quot; value=&quot;pr&quot;/&gt;<br />&nbsp; &lt;input type=&quot;hidden&quot; id=&quot;search_sort_column&quot; name=&quot;search_sort_column&quot; value=&quot;route&quot;/&gt;<br />&nbsp; &lt;input type=&quot;hidden&quot; id=&quot;id_recenter_ids&quot; name=&quot;id_recenter_ids&quot;/&gt;<br />&nbsp; &lt;input type=&quot;hidden&quot; id=&quot;id_recenter_layer&quot; name=&quot;id_recenter_layer&quot;/&gt;<br />&nbsp; &lt;input type=&quot;hidden&quot; id=&quot;search_sort_direction&quot; name=&quot;search_sort_direction&quot; value=&quot;asc&quot;/&gt;<br />&nbsp; &lt;input type=&quot;hidden&quot; id=&quot;search_number&quot; name=&quot;search_number&quot; /&gt;<br /><br />&nbsp;<br />&nbsp;&nbsp;&nbsp; &lt;div id=&quot;search_results_div&quot;&gt;&lt;/div&gt;<br />&lt;/p&gt;<br />&lt;/fieldset&gt;<br /><br />&lt;/div&gt;<br /><br />Anyone got an idea?<br /><br />Many thanks.<br />Claire<br /></p>