Hi Vlado,
I finally could identify the root of this issue!
ULC blocks the user interface during each synchronous server round-
trip. To signal the blocking state to the user, ULC displays an hour
glass mouse cursor. At the end of the server round-trip ULC then
resets the mouse cursor to its original state. In ULC Mobile this
reset is not done by the AWT Event Dispatch Thread. This is clearly a
violation of Swing's single thread rule. Sun's JVM seems to be more
robust concerning this violation whereas Creme's JVM just hangs. I
created the following JIRA entry for this issue: http://www.canoo.com/
jira/browse/UMO-65.
As a workaround instead of triggering the focus change with
transferFocus() you can use the following code construct:
Container topLevelAncestor = getBasicTextComponent
().getTopLevelAncestor();
long when = System.currentTimeMillis();
KeyEvent pressedEvent = new KeyEvent(topLevelAncestor,
KeyEvent.KEY_PRESSED, when, 0, KeyEvent.VK_TAB, '\t');
KeyEvent releasedEvent = new KeyEvent(topLevelAncestor,
KeyEvent.KEY_RELEASED, when, 0, KeyEvent.VK_TAB, '\t');
KeyEvent typedEvent = new KeyEvent(topLevelAncestor,
KeyEvent.KEY_TYPED, when, 0, KeyEvent.VK_UNDEFINED, '\t');
Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent
(pressedEvent);
Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent
(releasedEvent);
Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent
(typedEvent);
Regards Dany
On 01.10.2007, at 13:22, Vyvojava wrote:
Hi
I have a problem with extension to ULCMobile TextField for Symbol
barcode
scanner support. I need to call setValue() when scan button on
device is
pressed and then to transfer focus to the next focusable component.
As I don't know any other way to test this behaviour, I test it in
development mode by KeyboardAction being registered when the focus on
textfield is gained and unregistered when the focus is lost.
Everything's working fine this way, but the code is deployed to the
target
device (Symbol MC9090), the test application is not responding.
The test application registers FocusListener and
ValueChangeListener in
order to log the behaviour.
I think the order of the events in the development mode is
different from
the one happening on the actual device. In the device log, there
are no
statements about the focus being transfered.
Log from development mode:
application started
1191223496248 client focus gained listener: registered.keyboardaction
1191223496264 server focus gained listener: componentName ean8
1191223497811 client action listener: getValue null
1191223497811 client action listener: setValue value 1
1191223497811 client action listener: updateStateULC
1191223497811 client action listener: fireValueChangedULC
1191223497826 server valuechanged listener: setText 1: 52 - value 1
1191223497826 client action listener: transferFocus
1191223497826 client focus lost listener: unregistered.keyboardaction
1191223497826 server focus lost listener: componentName ean8
1191223497826 client focus gained listener: registered.keyboardaction
1191223497842 server focus gained listener: componentName ean8_2
1191223499045 client action listener: getValue null
1191223499045 client action listener: setValue value 1
1191223499045 client action listener: updateStateULC
1191223499045 client action listener: fireValueChangedULC
1191223499061 server valuechanged listener: setText 2: 52 - value 1
1191223499061 client action listener: transferFocus
1191223499061 client focus lost listener: unregistered.keyboardaction
1191223499061 server focus lost listener: componentName ean8_2
1191223499061 client focus gained listener: registered.keyboardaction
1191223499061 server focus gained listener: componentName ean8 dispose
Dispose
Client log from device:
1191137864267 client focus gained listener: registered.keyboardaction
1191137869603 client action listener: getValue null
1191137869776 client action listener: setValue value 1
1191137870084 client action listener: updateStateULC
1191137870247 client action listener: fireValueChangedULC
1191137870627 client focus lost listener: unregistered.keyboardaction
1191137871019 client focus gained listener: registered.keyboardaction
Server log (times arent synchronized on client and server):
09:37:15,587 INFO [STDOUT] application started
09:37:19,618 INFO [STDOUT] 1191224239618 server focus gained
listener:
componentName ean8
09:37:25,431 INFO [STDOUT] 1191224245431 server valuechanged
listener:
setText 1: 52 - value 1
09:37:25,837 INFO [STDOUT] 1191224245837 server focus lost listener:
componentName ean8
Application was terminated, so dispose messages are missing.
Thanks for reply
Vlado
----------------------------------------------------------------------
----
Tato sprava a vsetky pripojene subory su doverne a urcene vyhradne
osobam
alebo organizaciam, ktorym boli adresovane. Ak ste dostali tento e-
mail
omylom, prosim, upovedomte Chemosvit, a.s. ([EMAIL PROTECTED]).
This email and any files transmitted are confidential and intended
solely for the use of the individual or entity to which they are
addressed. If you have received this email in error, please notify
Chemosvit, a.s. ([EMAIL PROTECTED]).
----------------------------------------------------------------------
-----
<ULCSymbolTextField.java><TestSymbolComponent.java><UISymbolTextField.
java>
_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer