Announcement Announcement Module
Collapse
No announcement yet.
Webflow returns full page instead of tiles fragment Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Webflow returns full page instead of tiles fragment

    Dear Forum,

    I'm trying to get a demo webflow/tiles application to render a tiles fragment, but without success. Basically, instead of getting a fragment response, the full page is returned to the browser. As I understand it, this usually occurs if the request is NOT made using ajax, but looking at firebug, the request is being made as an ajax request.

    I've created as simple a demo as possible - a template contains a left hand menu, body and footer. There are links in the menu that are meant to trigger an async event that refreshes the body tile.

    Here's the template:

    Code:
    <tiles-definitions>
      <definition name="welcome" template="/WEB-INF/jsp/template.jsp">
          <put-attribute name="menu" value="/WEB-INF/jsp/menu.jsp"/>
          <put-attribute name="body" value="/WEB-INF/jsp/welcome.jsp"/>
          <put-attribute name="footer" value="/WEB-INF/jsp/defaultFooter.jsp"/>
      </definition>
    </tiles-definitions>
    Here's the webflow definition:

    Code:
    <flow ...>
    	<view-state id="start" view="welcome_page">
    		<transition on="changePage">
    			<render fragments="body" />
    		</transition>		
    	</view-state>
    </flow>
    Here's the template.jsp:

    Code:
    <body>
      <table>
          <tr>
              <td id="left"><tiles:insertAttribute name="menu" /></td>
              <td id="right"><tiles:insertAttribute name="body" /></td>
          </tr>
          <tr>
              <td colspan="2" id="bottom"><tiles:insertAttribute name="footer" /></td>
          </tr>
      </table>
    </body>
    Here's the welcome.jsp for the body tile:

    Code:
    <div id="body">
        Main area
    </div>
    The menu.jsp contains the links that are meant to refresh the body, here's that code:

    Code:
    <form:form method="POST" id="page1Form">
    <a id="page1" href="#">Page 1</a>
    </form:form> <script type="text/javascript"> Spring.addDecoration(new Spring.AjaxEventDecoration({ elementId: "page1", formId: "page1Form", event: "onclick", params: { _eventId: "changePage" } })); </script>
    For the sake of completeness, here's the form element after translation:

    Code:
    <form id="page1Form" action="/tiles-webflow-test/results?execution=e1s1" method="POST">
    <a id="page1" href="#">Page 1</a>
    </form>

    Unfortunately, as I said, the whole page gets returned. I'd really appreciate any help in identifying the problem
Working...
X