Search code examples
java-melcdui

J2ME populate ChoiceGroup dynamically


I am using LCDUI for my J2ME app. I have two Popup ChoiceGroup s. The 2nd CG's values should be dynamically populated based on the 1st CG's selection. I have tried the setItemCommand method but it doesn't work. How do I achieve the expected result. Any pointers would be greatly appreciated.


Solution

  • I have tried the setItemCommand...

    hm above sounds wrong way to me. Selection change events are intended to be handled with setItemStateListener / itemStateChanged pair not by item commands.

    Also even with state listener there is a chance that second group will miss refresh on some buggy device. If that happens to you, consider something like forcing screen change with short-timed Alert as a workaround