Skip to main content

Strange bug in latest LWUIT build (20080714) - Commands get swapped.

2 replies [Last post]
nafs
Offline
Joined: 2008-06-10

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.setLayout(new BorderLayout())
this.setScrollable(false)
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.

null

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
nafs
Offline
Joined: 2008-06-10

Oh, 1 more thing.. I just checked something..
When I do textfield.setReplaceMenu(false) the "bug" goes away and the behavior is similar to the previous LWUIT version.

chen

Hi,
Thanks for reporting this, we will fix this.

Chen

lwuit-users@mobileandembedded.org wrote:
> Oh, 1 more thing.. I just checked something..
> When I do textfield.setReplaceMenu(false) the "bug" goes away and the behavior is similar to the previous LWUIT version.
> [Message sent by forum member 'nafs' (nafs)]
>
> http://forums.java.net/jive/thread.jspa?messageID=286621
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net