HOWTO's and Patterns for Play Framework and other fun technologies.

localhost9000.com


Using the app/view/_partial naming convention to dynamic sub-content AJAX loading

Minimum Viable Example 2013-Jun-30 Taylor Brockman
Sequence Diagram for including server Partial content via browser AJAX
Sequence Steps:
  1. Browser requests main page: /index via GET
  2. Page defines a submit button plus empty div#searchResults landing zone
  3. JQuery custom script click event handler on user input control (button).
  4. Ajax anonymous function {1} triggers on input 'click' handler.
  5. Html writer anonymous function {2} triggers on ajax 'done' handler.
  6. Browser writes results of Browser writes results of _searchResults.html.scala into results landing zone div.
  7. Click button again to repeat. Add text input box for more fun.
Gist Source Example:
Screenshots:

Screenshot 1: Initial Page Load to /index




Screenshot 2: Page state after the AJAX request to _searchResults


Copyright © 2013 Taylor Brockman