package es.ideiak.cliente;

import java.util.Date;

import org.gwtmultipage.client.MultipageEntryPoint;

import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.data.Record;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.layout.VLayout;


@MultipageEntryPoint(urlPattern = "(fb.html)?(\\\\?gwt.codesvr=127.0.0.1:9997)?")


public class testcase implements EntryPoint {
	
	

	
	
	public void onModuleLoad() {
	
	
	
	ListGrid dates = new ListGrid();
	dates.setAutoFetchData(true);
	dates.setWidth(500);
	dates.setHeight(500);
	
	
	dates.setDataSource(DataSource.get("testcase"));
	
	IButton createDate = new IButton("CREATE");
	
	createDate.addClickHandler(new ClickHandler() {
		
		@Override
		public void onClick(ClickEvent event) {
			// TODO Auto-generated method stub
			
			Record r = new Record();
			
			r.setAttribute("date", new Date());
			
			DataSource.get("testcase").addData(r);
			
			
			
		}
	});
	
	VLayout VLO = new VLayout();
	VLO.addMember(dates);
	VLO.addMember(createDate);
	
	VLO.draw();
	
	
	}
	
	
	
}
