×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jan 2004
    Posts
    5

    MIDP 2.0 ItemStateListener on Nokia Emulator

    I am detecting user changes to a TextField on a Form using setItemStateListener(this).

    Works perfectly on the MIDP 2.0 sun emulators, but itemStateChanged(Item item) never gets called on the MIDP 2.0 Series_60_MIDP_Concept_SDK_Beta_0_3_1_Nokia_edition emulator, anyone else noticed this ?

    I haven't been able to try it a real device.

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    As far as I have been able to tell the itemStateChanged() event doesn't fire on Nokias until the Item loses focus, or the change is committed (like choosing OK after you edit a TextField), etc., and not as the changes are being made. You'll have to deal with that somehow.

    shmoove

  3. #3
    Registered User
    Join Date
    Jan 2004
    Posts
    5
    Ok, thanks for the sanity check )

    I reread the docs and it says:

    "It is up to the device to decide when it considers a new value to have been entered into an Item. For example, implementations of text editing within a TextField vary greatly from device to device. "

    So I guess it's not a bug in the emulator, it's just the way it works, I guess it's the same on a real device, which is a shame, I suppose I will have to write my own CustomItem TextField.

  4. #4
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    I guess it's the same on a real device
    It's like that on the devices I've tried: 3510i, 6100, 3300, 7650 and N-Gage. Looks like a pattern and that it's safe to say that that's the way it's implemented on Nokia handsets.

    shmoove

  5. #5
    Registered User
    Join Date
    Jan 2004
    Posts
    4

    I've noticed it...

    Hi!

    I've noticed this problem only with textField. It works fine with gauge and so on...
    I've tested it on Nokia 6600 and emulators. It worked on sun emulator. And ItemStateListener on textFiled worked in MIDP1 on Nokia 7250i. So i don't understand why doesn't work in (Nokia's) Midp2...

    Do you have a solution for this problem ? or i've to make it for example with CustomItem ? If there is no other way how can I make an own_TextField with CustomItem (how can i get a char not a keyCode ?) ?

    thank,
    szilsan
    Last edited by szilsan; 2004-01-15 at 09:22.

  6. #6
    Registered User
    Join Date
    Jan 2004
    Posts
    5
    The only solution I can think of is to forget itemStateChanged alltogether and just have a background thread which periodically reads the values of all the textfields in your form and calls a method on your from if any have changed.

    A bit sad, but it works.

    Now if I could only get customitem's which are taller than the screen to work properly on a 6600 then I will be a bit happier

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×