package com.test.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.ComboBoxItem;
import com.smartgwt.client.widgets.layout.HLayout;

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

	public void onModuleLoad() {
		HLayout hLayout = new HLayout();
		DynamicForm form = new DynamicForm();
		
		ComboBoxItem selectItem1 = new ComboBoxItem();
		selectItem1.setTitle("Animal");
		selectItem1.setType("comboBox");   
		selectItem1.setValueMap("Cat", "Dog", "Giraffe", "Goat", "Marmoset", "Mouse");
		
		ComboBoxItem selectItem2 = new ComboBoxItem();
		selectItem2.setValueMap("US", "CH", "JA", "IN", "GM", "FR", "IT", "RS", "BR", "CA", "MX", "SP");
		selectItem2.setTitle("Country");
		selectItem1.setType("comboBox");
		form.setFields(selectItem1, selectItem2);
		hLayout.addMember(form);
		RootPanel.get("gwt").add(hLayout);
	}
}
