package com.fircosoft.testlocale.client;

import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.core.Function;
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.SubmitItem;
import com.smartgwt.client.widgets.form.fields.TextItem;
import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
import com.smartgwt.client.widgets.layout.VLayout;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class TEST_Localization implements EntryPoint {

	/**
	 * This is the entry point method.
	 */
	public void onModuleLoad() {
		
		DataSource.load("operator", new Function() {
			
			@Override
			public void execute() {
				final DynamicForm f = new DynamicForm();
				f.setDataSource(DataSource.get("operator"));
				TextItem login = new TextItem("LOGIN","login");
				TextItem name = new TextItem("NAME","name");
				SubmitItem s = new SubmitItem("TEST2", "Submit");
				s.addClickHandler(new ClickHandler() {
					
					@Override
					public void onClick(ClickEvent event) {
						f.validate();
					}
				});
				f.setItems(login,name,s);
				
				VLayout l = new VLayout();
				l.setWidth100();
				l.setHeight100();
				l.addMember(f);
				l.draw();		
			}
		});
		
	}

	
}
