Can't change constraints for TextField

Hi all,
I am working on midlet and I need the following functionality at one form. On that form there are ChoiseGroup and TextField. Depends on choosen item in ChoiceGroup the TextField should become editable or uneditable. All works fine until TextField don't receive focus. If TextField receives focus and after that I choose item in ChoiceGroup which changes TextField's constraints I have got an exception
java.lang.NullPointerException
     at com.sun.midp.lcdui.DefaultInputMethodHandler.setConstraints(+63)
     at javax.microedition.lcdui.TextField$InputMethodClientImpl.setConstraints(+20)
     at javax.microedition.lcdui.TextField.setConstraints(+37)
     at com.usl.smash.mobile.form.AuthenticationForm$1.itemStateChanged(+92)
     at javax.microedition.lcdui.Form.callItemStateChanged(+27)
     at javax.microedition.lcdui.Display.callItemStateChanged(+14)
     at javax.microedition.lcdui.Display.access$900(+5)
     at javax.microedition.lcdui.Display$DisplayAccessor.callItemStateChanged(+8)
     at javax.microedition.lcdui.Display$DisplayManagerImpl.callItemStateChanged(+10)
     at com.sun.midp.lcdui.DefaultEventHandler.itemStateChangedEvent(+17)
     at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.run(+835)
Code snippet
String someText = choiceGroup.getString(choiceGroup.getSelectedIndex());
if(someText.equals("New")) {
  textField.setConstraints(TextField.ANY);
  textField.setString(null);
} else {
  textField.setConstraints(TextField.UNEDITABLE);
  textField.setString(someText);
}I am using J2ME Wireless Toolkit 2.2
Can somebody explain what I am doing wrong?
Thanks in advance

I wouldn't have set it null, instead placing an empty string " " instead:
if(someText.equals("New")) {
textField.setConstraints(TextField.ANY);
textField.setString("");
Perhaps?
Just a suggestion.
C

Similar Messages

  • Can't Change Labels for Properties

    I Can't Change Labels for predefine Properties
    or Custom Properties.
    I had done it with this:
    http://help.sap.com/saphelp_erp2004/helpdata/en/65/6fc63ed4027f6be10000000a114084/frameset.htm
    I just followed what the help said.
    but i can't see any change for my label of Properties.
    I had done it as follow steps.Please help me to
    Check if i miss some steps!
    1,I creat .properties files
      mylabels.properties
       in this properties file  i creat a key
           modified=date
      mylabels_zh_CN.properties
        in this properties file  i creat a key
           modified=u66F4u65B0u65E5u671F
    2,I made a jar file use the two .properties files
      named mybunding.jar
    3,I copy this jar file to
    .../j2ee/cluster/server<n>/apps/sap.com/irj/servlet_jsp/irj/root/web-inf/portal/portalapps/com.sap.km.common.resourcebundle/lib
    4, Create a new metadata extension under Content Management -> Global Services -> Property Metadata -> Metadata Extensions.
      named it  my_metadatae_extension
       set  Bundle File=com.sap.km.common.resourcebundle.mybunding.mylabels
    5,restart the servlet engine,
    6 in the key for label of the properties
        i set modified the key i creat in step 1.
    when i display the properties it still didn,t display
    my created lable.
    How should i do? any step i miss? or any better solution
    for the lable?
    Please help me ,
    BestRegards
    Han

    Hi Han,
    here my corrections:
    1.
    I would use the filename "mylabels_cn.properties" and not "mylabels_zh_CN.properties"
    2.&3.
    This is the SP2 way for using the bundle files for properties. For NetWeaver you need to create a new PAR-file with the bundle file including the labels and translations as described <a href="http://help.sap.com/saphelp_nw04/helpdata/en/65/6fc63ed4027f6be10000000a114084/frameset.htm">here</a>.
    It's very easy if you use the example PAR file provided by SAP in SAP Note 817876, as mentioned in the referenced link (Prerequisites section).
    Read carefully the process in the link and try again. If you still experience problems, come back with the new detailed description.
    Hope this helps,
    Robert

  • Where can I change desktop for anonymous user ?

    Hello.
    Where can I change desktop for anonymous user ? I'd like to change it in the same manner as sampleportal desktop (with amconsole) , but I did not found it in the amconsole.
    If you know, please, tell.

    The user "authlessanonymous" holds the information that people see if they are not signed on. It can be changed like any other user. It may have to be enabled under the Service Configuration tab -> portal desktop.

  • I am trying to change the order of one of my audiobooks (media kind: audiobook), but the ID tags are greyed out.  I can't change tags for almost all my audiobooks.  Music files OK. Files are all read/write. Repaired disc perms. OS 10.9.4. ITunes11.4

    I am trying to change the order of one of my audiobooks (media kind: audiobook), but the ID tags are greyed out.  I can't change tags for almost all my audiobooks.  Music files OK. Files are all read/write. Repaired disc perms. OS 10.9.4. ITunes 11.4  I don't have iTunes Match.

    Select all the songs and then Advanced -> Convert ID3 tags.
    http://docs.info.apple.com/article.html?path=iTunesWin/6.0/en/655win.html

  • Can we change skin for menus??

    Can we change skin for menus, or doing some changes on firmware??

    Officially, no.
    However there are lots of hacks at sites like iPod Wizard.
    Hacking the iPod may very well void the warranty.
    Do it at your own risk.

  • Mi iPhone 5 is broken can i change it for iPhone 5s

    Mi iPhone 5 is broken can i change it for iPhone 5s

    If you sell the iPhone 5, you can purchase a 5s. However, if you intend to take it into Apple for service, they will replace it with a like model, same color, same capacity, same provider.

  • Can i change colors for events in the calendar?

    Can I change colors for different events in Calendars on Ipad 2?

    Philly - I always respect your opinion and what you have to say but please hear me out.
    Philly_Phan wrote:
    I see one iCal window and that makes me conclude that I have one calendar with multiple event types.
    You understand how the app works and how to create calendars. As I pointed out - I explained to one user that you have to tap the Calendar button in the upper left corner and then select the calendars that you want to view. In fact, if you have accidentally tapped Hide All Calendars - you see no events.
    I totally understand what you are saying and I rarely take an argumentative approach in this forum, but what I am trying to point out to the OP is that you cannot create different colors for "events" in one single calendar.
    For instance, if you have one calendar called "Home" and that is the one calendar that you use - if Billy has a soccer game at 6:00 PM, Jessica has band practice at 7:00 PM and you have a bridge club meeting (I'm stuck for another idea at the moment ) at 7:30 PM - and you want all of these "Events" to appear in different colors within the same calendar - it cannot be done.
    Sometimes I think this is what users want to do - differentiate the different "Events" within a single calendar - and that cannot be done - at least AFAIK.
    I didn't mean to cause confusion nor was I trying to complicate things. I just thought that I was giving a complete answer as to how the feature works.
    After all - I could have just used the "please get the iPAD user guide" line.  I just love that response.

  • My Firefox home page displays a weather icon for New York , how can I change it for my own location? It only shows for USA

    At the bottom of the screen there are several icons for weather forcasts ect. for New York. How can I channge these icons to show the forecast for my own location? When I try to change location all I can get are locations for the USA

    What web page do you have set as your homepage?

  • Where is scroll bar for notes? can you change sorting for notes to A-Z?

    is there a scroll bare for NOTES in icloud? Can you change sorting to A-Z?

    Are you asking about viewing your Notes on https://www.icloud.com/#notes  on a Mac?
    In Safari the scrollbar will appear, when you start to scroll the note list with a trackpad or a mouse.
    In the Notes.app the scroll bar will always be visible, if you enable the scroll bars in System Preferences > General > Show Scroll Bars > Always
    In the Notes-app the list can be sorted by title from the "View > Sort by" menu, but on icloud.com I do not know of a similar option.

  • How can I change text for paginate button?

    I use Table (not DataTable) in the web application (NetBeans IDE 6.0.1). There are so called pagination controls buttons in the table. I?d like to change text in the buttons. How can I do it? For example ?Go? button text I like to change to another language. How can I change the text of ?Go? button via the language file. I like to also change the tooltips text of table via language file.

    You need a NetBeans forum. This one's for Java.
    db

  • How can I change password for ora8?

    How can I change the default password for the default internal
    account with password oracle 8?
    null

    where i find the orapwd and how i use it.
    Use the tool orapwd80 to change the password for the internal account.

  • TS2634 MY IPOD 5G DOSNT WANT TO CHARGE I HAVE WITH IT 4 DAYS CAN I CHANGE IT FOR ANOTHER ONE I DIDNT BUY THE WY OR TE PROTECTIONHARANT

    PLEASE HELP ME I AM WONDERING IF I CAN CHANDE MY IPOD FOR ANOTHER ONE I DIDNT BUY THE WARANTY OR THE PROTECTION BUT I JUST HAVE 4 DAYS WHITH IT

    Yes, just go in and explain the problem. If you have the receipt thats ok but it is not required, the can verify the warranty using the serial number. They may run some diagnostics on it, and if there is indeed a hardware issue then you will get a replacement. 

  • How can i change "image_size" for pm-utils?

    Hey,
    I'd like to change the image_size file for pm-utils (used for hibernation), if i try to open the file with VI and save it afterwards i get a strange errorcode (E667), the errormessage is in german ("image_size" E667: Fsync fehlgeschlagen) and should be something like "E667: Fsync failed".
    Anyone got some idea?
    I'd like to change the size to approx. 4 GB, my thought was to just replace the leading 5 in image_size with 40. Is that a good idea?
    Thanks and cheers,
    hubutz

    /sys/power/image_size controls the size of the image created by
    the suspend-to-disk mechanism. It can be written a string
    representing a non-negative integer that will be used as an upper
    limit of the image size, in bytes. The suspend-to-disk mechanism will
    do its best to ensure the image size will not exceed that number. However,
    if this turns out to be impossible, it will try to suspend anyway using the
    smallest image possible. In particular, if "0" is written to this file, the
    suspend image will be as small as possible.
    Reading from this file will display the current image size limit, which
    is set to 500 MB by default.
    Source: http://www.mjmwired.net/kernel/Document … erface.txt

  • Can't change password for mobile user on certain client computers

    I have a MacBook Pro that has mobile user accounts. The user accounts are defined in the WGM of my macpro Server. The mobile user account works fine except that after some time I could not change the password on the client computer. I could change it in WGM but then it was not updated on the client. I tried changing the password from the SystemPreferences -> Accounts option as well as from the command line with "passwd". When using the command line passwd it just says "sorry". When using the Accounts option it asks to contact the "system manager".
    I called Apple Support. They suggested recreating the mobile user account on the client. I did that, and everything worked fine, including changing passwords on the client. But, after several weeks, I again cannot change the password on the client. I can change it in WGM fine, but again the client is not updated.
    It seems that the password database on the client gets confused about user password changing privileges after some time.
    To make matters more complicated, everything works fine for another client computer, including changing passwords.
    Any suggestions?

    This problem was related to the case sensitivity of computer names. I had recreated the LDAP binding to the client computer with the computer name in all lower case
    characters. However, when I created the mobile user initially, I had used a mix of upper and lower case characters (the name that shows up upon reverse DNS lookup). Once I re-created the LDAP binding with the original name, everthing worked fine.

  • Can't Change Password for SSID's any longer!!!

    I have 3 Cisco WAP 2000 and have two SSID's set up with passwords. I usually change the passwords every 3 months or so, but now when I log in I can't even see where I can change the passwords. there is no longer a drop down list under Wireless. There actually aren't any drop down lists under any of the Menu items any longer. So weird. Any help is appreciated. Thank you
    Shauna

    Hello Shauna,
    Issues like this are usually related to the browser your are using, or possibly your anti-virus/security software.
    Try opening the page in a different browser.  Firefox tends to work the best.  I would also recommend checking your firmware to see if it can be updated to support a newer browser.
    Since the WAP2000s are a bit older, you can also try as early a version of Internet Explorer as you can find, or running in compatibility view.
    Thank you for choosing Cisco,
    Christopher Ebert - Network Support Engineer
    Cisco Small Business Support Center
    *please rate helpful posts*

Maybe you are looking for