3 Replies Latest reply on Oct 6, 2012 12:46 AM by gose - oracle

    Avoid full page refresh on reference application

      I am trying to modify the Discovery Electronics reference application so it does not do a full page refresh when an item of the guided navigation is clicked or when a search is submitted.
      I noticed ajax is implemented in the searchbox control to retreive suggestions and was wondering if the same functionality could be applied to the onlick events of the refiners.

      Any additional information/suggestions would be greatly appreciated.

        • 1. Re: Avoid full page refresh on reference application
          gose - oracle
          It is certainly possible and pretty independent of Endeca. Your controller just needs to respond to your AJAX requests which you'll then use to update the DOM. It's important to consider though that when a user clicks on Guided Navigation or performs a search, many components on the page may need to be updated. For example, if a user searches, all of the following will change: Guided Navigation, Breadcrumbs, "Did you mean?", Search Results, Merchandising Rules, Pagination, and maybe Dimension Search results.
          • 2. Re: Avoid full page refresh on reference application
            Can a simple example be provided?

            I imagine it is possible, as I have done something similar custom .Net apps, although I have no clue on how to get started on the Endeca framework.
            • 3. Re: Avoid full page refresh on reference application
              gose - oracle
              I wouldn't think of this as an Endeca problem. Start simple by just replacing one thing on the page when a user clicks something. Let's say a user clicks on one of the links in Guided Navigation and you want to replace the Search Results. Using unobtrusive Javascript, you would override the anchor href target with an AJAX call. That call will go out to a special method on your Controller that responds with new search results (either a JSON object or HTML snippet). The returned object should then be used to update the appropriate part of the DOM. You may find it useful to start with an even simpler example. Render an HTML page with an anchor tag, write some Javascript to override it with an AJAX call. Let's say your AJAX calls a method which returns "Hello World". Take the return object and use it to populate an element on the page.