How to use and append data to Masonry in responsive jQueryMobile with JSF 2 and ajax

This is a demonstration on using Masonry, a grid layout JavaScript library, in a responsive JSF 2 page with jQueryMobile framework. This also shows how to do partial update, appending new grid items to Masonry by fetching additional data from the server via JSF <.f:ajax /> requests. The following assumes that you have included in a page the necessary jQuery, jQueryMobile, Masonry, and ImagesLoaded JavaScript and CSS files. This is based on MyFaces 2.2.3 JSF implementation, version 1.43 of jQueryMobile (JQM), and Masonry version 3.2.