Search code examples
javacodenameonepicker

codename one picker not selecting


I run the following codenameone code in a blank project and it "run"'s in the simulator and selects properly.

Then I "build" the project, or refresh the cn1 libraries and after the successful build, it runs in the simulator, but will not select elements.

This is happening after the xml files are rebuilt by either building the project, refreshing the cn1 libraries, or generating a certificate for Windows.

Netbeans 8.2, Simulator, Windows Desktop 1803, Windows Phone 14393, Windows Phone 15063, Codename One 4.0.3, jdk 8

The picker selects normally when sent to Android Phone.

I was not having this problem a year ago.

    Form f = new Form("Picker", BoxLayout.y());
    Picker p = new Picker();
    p.setType(PICKER_TYPE_STRINGS);
    String[] s = {"1", "2", "3"};
    p.setStrings(s);
    f.add(p);
    f.show();

Solution

  • Update Project Libraries:

    Right click project -> Codenameone -> Codenameone Settings -> Basics -> Update Projects Libs

    (Update Project Libs button is bottom left hand side of page).

    NOTE: the new picker may be slow responding on UWP phone devices. See

    https://github.com/codenameone/CodenameOne/issues/2478

    NOTE: the new picker works well with UWP phone device as of 7/27/2018 codenameone library update.