FormItemInitHandler onInit() giving me a TextItem instead of a FormItem

I have a custom CanvasItem which has a FormItemInitHandler. The item works great when it is in a regular dynamic form, but I’m trying to use it as an editor type in a ListGrid. The ListGrid is using a ListGridEditorCustomizer to determine when to use this item for editing a cell. My problem is appearing when I begin editing a ListGrid cell and this editor needs to appear.

The FormItemInitHandler method onInit() gives me access to the FormItem being initialized. Since my item is CanvasItem, I need to be able to cast the FormItem to a CanvasItem in order to call storeValue() in a couple places inside onInit(). This is no problem when using the item in a regular DynamicForm, but when the item is created inside the grid from the ListGridEditorCustomizer, the item I get in onInit() is a TextItem, which I cannot cast to a CanvasItem.

Is there a way to make onInit() give me a FormItem or CanvasItem here instead?

I’m using a SmartGWT nightly 2.5 from 11/25 in Chrome and Firefox.

Did you get a chance to look at this? I haven’t found a workaround yet, the object passed to me in onInit() is still a TextItem when my CanvasItem editor is created in the ListGridEditorCustomizer. onInit() needs to give me a CanvasItem or FormItem so I can cast it and have access to methods like storeValue().

Thanks for any assistance!

See the docs for setEditorType(), this issue and it’s solution are covered in detail.