Strange bug in latest LWUIT build (20080714) - Commands get swapped.
I noticed this bug while using the Autocomplete Textfield (as explain in Shai's blog) feature of my app. Though I am unsure if it has anything to do with it.
I apologise for my slightly lengthy explanation of this issue, since I am unable to narrow it down. Though the bug itself is easy to understand.
Here's the relevant code in my Form's constructor:
this.addComponent( BorderLayout.NORTH, searchField ); //searchField is the TextField I am using for the Proxyfiltering...
this.addComponent( BorderLayout.CENTER, newsList ); //a List containing news items.
backCommand = new Command( "Back" );
goCommad = new Command( "Go" );
this.addCommand( backCommand ); //left side
this.addCommand( goCommand ); //right side
note the order in which I am adding the commands.
How it worked in the previous build.
Well, when I start pressing in letters in the Textfield the List would dynamically change. As expected. Worked great.
Also, when I am in the Textfield 2 additionally commands would automatically get added to the Form ("T9" and "Clear"). So now my Form has 4 Commands (T9, Clear, Go, Back). Then when I move focus away from the TextField and to my List, the T9 and Clear commands would dissapear and the Form would be left with my original Commands (Back and Go, in that order).
How it works in the current build. 20080714
When I am in the Textfield and start entering the letters, the Back and Go commands are removed and replaced by T9 and Clear command. This is fine, in fact, better in my opinion. Then when I move focus away from the TextField and to my List, the T9 and Clear commands dissapear and Form is left with my original commands, Go and Back... but their order is reversed! This is the BUG.