In the web app I'm developing at the moment I need to be able to read in text files and output the data from them onto the screen. Depending on the type of the file, sometimes I need to allow editing of the file content on the screen and sometimes I need to prevent the user from doing so. Also, some files that I need to read in can be quite large so I need to download their content 'page-by-page'. Currently I have h:inputTextarea on the web page to display the data. I can handle editability easily, but I don't know how I can trigger the Java code to download next chunk of data from the file. Maybe it is not possible to do this using h:inputTextarea? Should/Can I use some combination of rich:faces components for this? Does anybody know of an elegant way to do this, possibly by detecting when scrolling down reaches the end of the available data which then triggers an action back to the server to load in more?
Basically what I want to achieve is a Notepad-lie functionality that reads in page worth of data every time the user hits the bottom of the current page.
Your help would be greately appreciated.