OptionGroup Help

Hi I need Help with this scenario.

I have a a data source that has a field of type integer

private class FormFieldFactoryA extends DefaultFieldFactory
		public Field createField(Item item, Object propertyId,
				Component uiContext)

			if ("type".equals(propertyId))
				OptionGroup optiongroup = new OptionGroup();


				optiongroup.setItemCaption(1, "regular");
				optiongroup.setItemCaption(2, "nonregular");

				return optiongroup;
			} else if ("name".equals(propertyId))
				TextField tf = new TextField("Name");

				return tf;

			return super.createField(item, propertyId, uiContext);

public class Person implements Serializable
	String name;
	Integer type;

How do I override a form DefaultFieldFactory to generate 3 select box. That is binded to the data source.

Label Value
#regular 1
#nonregular 2
#Special 3

note: Currently I can only print the select boxes but they are not checked even if the data source item has the proper employee type value.

Can the answer please include a code snippet.

Anyone? I could really use some help hereā€¦