FormItem setValue() causing exception

I’m getting a this.form = null exception when I attempt a setValue() directly on a FormItem in a form. Any ideas what might cause this?

It looks like if I set the value through the parent form I don’t get this exception

DynamicForm myForm = new DynamicForm();
TextItem myField = new TextItem(“field”,“Text Field”);
myForm.setFields(myField);
myForm.setValue(“field”,“some string”); //works
myField.setValue(“some string”); //exception