codenameonepickergui-builder

Picker & GUI Builder, how to set the type


Since the type property for picker objects are not exposed in the GUI Builder, what's the proper way to set the type via code for a picker object placed using the GUI Builder?

I've tried doing so in various form event methods (primarily initVars, onCreateMain and beforeMain), with no luck. this.findPicker() returns null in those situations (this is not unique to picker, this.findAnything fails in those same methods).


Solution

  • I would suggest migrating to the new GUI builder. It seems the bug is there too and you should file that bug against it.

    Regardless for both GUI builders you can just invoke setType() in the constructor right after the init call as a workaround or in the beforeForm event for the old GUI builder.