Gravatar for gdubey@deloitte.com

Question by govinddubey, Jun 6, 2016 10:12 AM

standalone search box script - Getting Uncaught TypeError: Cannot read property 'configureSampleEndpoint' of undefined in chrome Console

Hi,

Getting Uncaught TypeError: Cannot read property 'configureSampleEndpoint' of undefined in chrome Console while implementing standalone search box script. after adding all JS dependencies as mentioned in this doc https://developers.coveo.com/display/public/JsSearchV1/Adding+a+Standalone+Search+Box

wrote the below script:

<script type="text/javascript">                
    $(function () {
        Coveo.SearchEndpoint.configureSampleEndpoint();
        $('#searchBox').coveo('initSearchbox', 'url/of/page');
    });
</script>  
1 Reply
Gravatar for mlaporte@coveo.com

Answer by Martin Laporte, Jun 6, 2016 1:50 PM

You might be using a pre 1.0 version of the JS UI framework, where the SearchEndpoint class was under Coveo.Rest (aka Coveo.Rest.SearchEndpoint).

Gravatar for gdubey@deloitte.com

Comment by govinddubey, Jun 7, 2016 1:49 AM

after changing Coveo.SearchEndpoint.configureSampleEndpoint(); to Coveo.Rest.SearchEndpoint.configureSampleEndpoint(); getting Uncaught No method or component named initSearchbox are registered.

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Jun 7, 2016 8:42 AM

It would be "initSearchBox" with an uppercase "B" for Coveo JavaScript Search Framework 0.9.

It would be easier if you follow the documentation for the version 0.9 of the Coveo JavaScript Search Framework: https://developers.coveo.com/display/public/JsSearch/Adding+a+Standalone+Search+Box

Gravatar for gdubey@deloitte.com

Comment by govinddubey, Jun 8, 2016 6:28 AM

Hi,

Now my search page is not able to display the records while implementing Standalone searchbox in Home Page and in Chrome console of search page below message is there:

Two folding component are active at the same time for the same tab. Can't process result !

My search page is having one pageblock there i have included the Coveo searchInterface component (configured the coveo full search page) and added the required script also mentioned in the above link:

<script>
 $(function () {
    Coveo.Rest.SearchEndpoint.configureSampleEndpoint();

    $('#search').coveo('init', {
      externalComponents: [$('#searchBox')]
    });
  });

</script>
<apex:pageBlock >
    <div id="search">
        <CoveoSolutions:SearchInterface />
    </div>
    <!--apex:include pageName="coveo_test"/--> 
</apex:pageBlock>
Gravatar for mlaporte@coveo.com

Comment by Martin Laporte, Jun 8, 2016 6:40 AM

I added an answer to your separate question https://answers.coveo.com/questions/6580/search-page-is-not-able-to-display-the-records-while-implementing-standalone-searchbox-chrome-console-message-two-folding-component-are-active-at-the-same-time-for-the-same-tab-cant-process-result

Ask a question