static public class LoadNextActionListener extends EventListener<UIVirtualList>
{
public void execute(Event<UIVirtualList> event) throws Exception
{
UIVirtualList virtualList = event.getSource();
UIDataFeed dataFeed = virtualList.getDataFeed();
WebuiRequestContext rContext = event.getRequestContext();
try
{
dataFeed.feedNext();
}
catch (NoSuchDataException e)
{
// Update parent of virtual list to refresh
event.getRequestContext().addUIComponentToUpdateByAjax(virtualList.getParent());
return;
}
if (!dataFeed.hasNext())
{
rContext.getJavascriptManager().addJavascript(
"eXo.webui.UIVirtualList.loadFinished('" + virtualList.getId() + "');");
}
rContext.getJavascriptManager().addJavascript(