Click here to Skip to main content
15,867,771 members
Articles / Programming Languages / Java / Java SE / J2EE

Modular J2EE, Using Spring DM, Zk and EclipseLink

Rate me:
Please Sign up or sign in to vote.
4.92/5 (9 votes)
21 Apr 2011CPOL15 min read 52.4K   401   8  
This article describes how to create a basic modular Java Enterprise Application, by using these Open Source frameworks
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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead
Morocco Morocco
Adrabi!, Just another Ghost in the Shell =)

Comments and Discussions