|
package com.cp.adrabi.jln.web.todo.controllers;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zul.Grid;
import org.zkoss.zul.ListModelList;
import com.cp.adrabi.jln.web.todo.components.TodoRowModel;
/**
* Controller for listing Todo in database
*
* @author ADRABI Abderrahim (z3vil)
*
*/
public class ControllerListTodo extends ControllerBaseTodo
{
/**
*
*/
private static final long serialVersionUID = 1L;
private Grid gdListTodo;
@Override
public void doAfterCompose(Component comp) throws Exception
{
super.doAfterCompose(comp);
this.loadTodoLis();
}
/**
* Load todos and add them grid
*/
private void loadTodoLis()
{
this.gdListTodo.setModel( new ListModelList( this.service.getListTodo() ) );
this.gdListTodo.setRowRenderer(new TodoRowModel());
}
/**
* Redirect to new todo page
*/
public void onClick$btnNew()
{
Executions.sendRedirect("/admin/todo/new");
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.