Infinite scrolling with p:remoteCommand and offset as function. The offset defines a waypoint if the bottom of the element is in view. When resizing the window, this offset will be recalculated automatically. The Waypoint component self is used in combination with pe:javascript. In the callback function we check the current scrolling direction. Furthermore, we use two widget methods: disable() and enable(). The method disable() temporarily disables the waypoint (callback function) from firing, but leaves the waypoint's event bound. Calling enable() again in the future would re-enables a previously disabled waypoint and the old handlers would continue to work. ${showcase:getFileContent('/sections/waypoint/examples/example-infiniteScrollingOne.xhtml')} === first remote content from the file remoteContentOne.xhmtl (for demo purpose) ${showcase:getFileContent('/sections/waypoint/examples/remoteContentOne.xhtml')} === second remote content from the file remoteContentSecond.xhmtl (for demo purpose) ${showcase:getFileContent('/sections/waypoint/examples/remoteContentSecond.xhtml')} ${showcase:getFileContent('/org/primefaces/extensions/showcase/controller/waypoint/InfiniteScrollController.java')}