Results 1 to 2 of 2

Thread: How to handle Browser History Object when using AjaxEventDecoration to refresh page

  1. #1
    Join Date
    Jul 2010
    Posts
    4

    Default How to handle Browser History Object when using AjaxEventDecoration to refresh page

    Hello

    I am using Spring Javascript and Dojo and Tiles2 to refresh part of a page.

    This is how it is implemented:
    The following code iterates throug links with the class "ajaxLink" and adds event listener that fires a remote Ajax request to the server.

    Code:
    dojo.query(".ajaxLink").forEach(function(element) {
        Spring.addDecoration(new Spring.AjaxEventDecoration({
            elementId: element.id,
            event: 'onclick',
    	params: { fragments: 'content'}
        }));
    });
    In tiles-defs.xml:
    Code:
    <definition name="welcome" extends=".mainTemplate">
      <put-attribute name="activeMainMenu" value="home" type="string" />
      <put-attribute name="content" value="/WEB-INF/views/welcome.jsp" />
    </definition>
    Versions:
    Spring Framework - 3.0.1.RELEASE
    Spring Web Flow - 2.0.5.RELEASE
    Tiles2 - 2.1.2

    This works like a charm, but my question is this:
    Is it possible to handle the Browser History Object to handle the back button?

  2. #2
    Join Date
    Jul 2010
    Posts
    4

    Default

    I think I've found the answer to my own question.

    Unless you use some kind of flow, there is no build-in-handling for the browsers back button and the only solution seems to add some custom Browser History Manager.

    When building flows, this thread explains how to configure a global transition for a back button:
    http://forum.springsource.org/showthread.php?t=30842

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •