Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User pawanv's Avatar
    Join Date
    Oct 2011
    Posts
    4
    I have created an application in J2ME in which i have created a form and appended multiple text fields using Itemstatelistener method.The scenario is I have used Name,Age,DOB,Income fields in which i am INSERTING an Income field on any entry in Age field by using Itemstatechanged(). The problem i am facing here is whenever i enter Age,Income field gets inserted after DOB field and then when i try to enter in DOB field the value of DOB is getting entered in Income field.The focus shifts to Income field whenever i try to enter DOB. Its a device specific problem i.e its happening only SAMSUNG phone devices.

    public Form getInput_form() {
    if (input_form == null) {

    input_form = new Form("", new Item[]{getTxtName(), getTxtAge(), getDOB()})
    input_form.addCommand(getCmdBACK());
    input_form.addCommand(getInput_Ok());
    input_form.setCommandListener(this);
    input_form.setItemStateListener(this);
    }
    return input_form;
    }

    public void itemStateChanged(Item item)
    {
    if(item.equals(txtAge))
    {
    if(!(txtAge.getString().equals("")))
    {
    if(Integer.parseInt(txtAge.getString()) > 18)
    {
    if(txtIncome ==null)
    {
    txtIncome = new TextField("DAB SUM",getIncomeSum(), 8, TextField.NUMERIC);
    input_form.set(3,txtIncome);
    }
    }
    }
    }
    }

    Here is the code and above i have explained my query.

  2. #2
    Nokia Developer Expert skalogir's Avatar
    Join Date
    Aug 2011
    Posts
    547
    Hi pawanv,

    Can you please provide a full working code including the code in the functions
    getTxtName(), getTxtAge(), getDOB(), getCmdBACK(), getInput_Ok());

Similar Threads

  1. Need help with an ItemStateListener.
    By John_123 in forum Mobile Java General
    Replies: 14
    Last Post: 2011-10-21, 07:10
  2. need help using the itemstatelistener....
    By farzia in forum Mobile Design and User Experience
    Replies: 0
    Last Post: 2011-06-06, 14:05
  3. j2me query
    By yatibawri in forum Mobile Java General
    Replies: 1
    Last Post: 2009-11-28, 05:51
  4. J2ME programming query
    By hrishi24h in forum Mobile Java General
    Replies: 3
    Last Post: 2008-10-19, 07:54
  5. itemStateListener
    By cpanon in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2007-09-06, 05:05

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved