package test.client;

import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.events.ItemChangedEvent;
import com.smartgwt.client.widgets.form.events.ItemChangedHandler;
import com.smartgwt.client.widgets.form.fields.RichTextItem;
import com.smartgwt.client.widgets.form.fields.TextAreaItem;
import com.smartgwt.client.widgets.layout.VLayout;

public class TestIso implements EntryPoint {
	

	public void onModuleLoad() {

		final DynamicForm commentForm = new DynamicForm();
		commentForm.setHeight100();

		TextAreaItem commentAreaItem = new TextAreaItem("comment");
//		RichTextItem commentAreaItem = new RichTextItem("comment");
		commentAreaItem.setWidth("*");
		commentAreaItem.setHeight("*");
		commentAreaItem.setColSpan(2);
		commentAreaItem.setStartRow(true);
		
		commentAreaItem.setValue("Comment Line 1 " + '\n' + " Line 2" + '\n' + "Line 3" + '\n' + " Line 4" + '\n' );
//		commentAreaItem.setValue("Comment Line 1 <BR> Line 2<BR> Line 3  <BR>Line 4<BR>" );

		commentForm.setItems( 
				commentAreaItem
				);

		
		commentForm.addItemChangedHandler(new ItemChangedHandler() {
			@Override
			public void onItemChanged(ItemChangedEvent event) {
				SC.say("Item Changed: " + event.getItem().getName());
			}
		});


		VLayout layout = new VLayout();
		layout.setMembersMargin(10);
		layout.setHeight100();
		layout.setWidth100();
		layout.addMember(commentForm);
		
		layout.draw();


	}

}