gwtchosen 3.0 NPE issue with clear() and update()

36 views
Skip to first unread message

Rogelio Flores

unread,
Oct 10, 2015, 4:34:46 AM10/10/15
to gwtquery
I've been using gwtchosen successfully. With code that runs fine in gwtchosen 2.1, it now fails whenever I call chosenListBox.clear() or chosenListBox.update() with the following (same stacktrace for both):

ERROR: Uncaught exception escaped
com.google.web.bindery.event.shared.UmbrellaException: Exception caught: null
at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:203)
at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
at com.arcbees.chosen.client.gwt.ChosenListBox.update(ChosenListBox.java:722)
at com.arcbees.chosen.client.gwt.ChosenListBox.clear(ChosenListBox.java:323)
at com.arcbees.chosen.client.gwt.ChosenListBox.clear(ChosenListBox.java:317)


Is this the same issue as

Is there a workaround?

Maxime Mériouma-Caron

unread,
Oct 16, 2015, 7:47:50 AM10/16/15
to gwtquery
Hi Rogelio,


This will be fixed by https://github.com/ArcBees/gwtchosen/pull/279 and/or https://github.com/ArcBees/gwtchosen/pull/280. I've added a test for that in #280

Please try the new 3.1-SNAPSHOT after we merge those 2 pull requests.

Rogelio Flores

unread,
Oct 23, 2015, 7:04:10 PM10/23/15
to gwtquery
I can confirm that 3.1-SNAPSHOT solves this issue.


However, there's another issue. When I set options programmatically like this:

chosenListBox.addItem(displayName1, id1);
chosenListBox.addItem(displayName2, id2);

and then set the first one to be selected:

chosenListBox.setSelectedIndex(0);

the widget displays as if there is no selection; that is, gray text and down-arrow (see image below). Trying calling the update() and/or forceRedraw() doesn't solve the issue. If you know of a workaround (other than changing the text/arrow color via css), let me know. Thanks.

Maxime Mériouma-Caron

unread,
Oct 27, 2015, 2:45:14 AM10/27/15
to gwtquery
Thanks for reporting. I've opened a new pull request to address this. A new snapshot should be available in the next few days
Reply all
Reply to author
Forward
0 new messages