Closed steveplatz closed 11 years ago
I think this may be an error in ControllerUtils.getSelectionForEnum
I had a very difficult time writing this method, I mostly cobbled it together from various bog posts. There was no clear or easy way to turn an enum into a drop down.
I thought perhaps it was because I was not incrementing valueCount, but incrementing it had no effect. I'm not sure what the problem is here.
Maybe in the controller we need to turn the integer values from the selection field back into their Enum values?
I think I may have found what is causing this. There was one logic error in that method, where the count was never incremented, but rather than do that, I changed it to read the value directly from the enum. Now, I just need to wire up the view so it understands that those values are for the batch type. Hopefully it should be done soon.
There were a few things that I needed to do for this to work.
I forgot to mention... I didn't create any tests for this, so we'll want to do that as well when time permits.
This might also fix part of the error with BatchActions. They also use that enum helper method. Maybe we have to add the model code for them as well.
When a new batch is created, the type is always set to "Beer", no matter which type is selected.