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
	{
		@Override
		public Field createField(Item item, Object propertyId,
				Component uiContext)
		{

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

				optiongroup
						.setItemCaptionMode(OptionGroup.ITEM_CAPTION_MODE_EXPLICIT);

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

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

				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ā€¦