package de.testcase.client;

import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.layout.VStack;
import com.smartgwt.client.widgets.toolbar.ToolStripButton;

public class Testcase implements EntryPoint
{
	@Override
	public void onModuleLoad()
	{
		SC.showConsole();

		final VStack stack = new VStack();
		stack.setHeight100();
		stack.setWidth100();

		final DynamicForm firmaForm = new DynamicForm();
		firmaForm.setDataSource(DataSource.get("DatasourceA"));

		stack.addMember(firmaForm);

		firmaForm.editNewRecord();

		final ToolStripButton sb = new ToolStripButton("save");
		sb.addClickHandler(new ClickHandler()
		{

			@Override
			public void onClick(final ClickEvent event)
			{
				firmaForm.saveData();
			}
		});

		stack.addMember(sb);

		stack.draw();
	}
}
