×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Mar 2013
    Posts
    3

    KeyPad showing up Secondary value rather than primary value

    Hi All,I am really stuck with the issue.Any suggestion would be really helpful,

    I am having a strange issue with Asha 201 in My app.
    One of the screens in My app lists down all the text value and i have a search text on top of it.When I press a key, say I press G, the text box shows up 5(which is alternative value for G in the keypad).This happens only for the first character,The consecutive characters show up for watever the value is typed.i have implemented 'ItemstateChange' for this screen and checkin the state change for the search text bos.This App works fine on Nokia X2-02 and E63 and E5 also.

    Any help would really great.

    Regards,
    Srikanth

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: KeyPad showing up Secondary value rather than primary value

    Is it similar to this issue?

    Graham.

  3. #3
    Registered User
    Join Date
    Mar 2013
    Posts
    3

    Re: KeyPad showing up Secondary value rather than primary value

    Hi Graham,
    Not exactly to that issue.But it is similar. i have text labels dynamically populated and it looks like ItemstateChange method is called twice instead of once when i press a key.

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: KeyPad showing up Secondary value rather than primary value

    From the other thread, it does sound like there are issues with TextFields on Series 40 devices with QWERTY keyboards, under certain circumstances.

    Can you create the most minimal example of code that re-creates the issue?

  5. #5
    Registered User
    Join Date
    Mar 2013
    Posts
    3

    Re: KeyPad showing up Secondary value rather than primary value

    Hi Graham,

    I have recreated the scenario..Its somethin simialrto wat i am doin but this code doesn gimme the issue

    import java.io.IOException;
    import java.util.Date;
    import java.util.Vector;

    import javax.microedition.lcdui.Display;
    import javax.microedition.lcdui.Form;
    import javax.microedition.lcdui.Item;
    import javax.microedition.lcdui.ItemStateListener;
    import javax.microedition.lcdui.TextField;
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.midlet.MIDletStateChangeException;

    public class MideltForm extends MIDlet implements ItemStateListener {
    private Form form;
    TextField tf;
    Vector vElements;
    Display disp;
    public MideltForm() {
    form = new Form("some form");
    tf = new TextField("Search", "", 10, TextField.ANY);
    vElements = new Vector();
    for(int r = 0; r<1000;r++){
    vElements.addElement("Ga1"+r+"\n");
    /* vElements.addElement("Ga3\n");
    vElements.addElement("Ga2\n");
    vElements.addElement("Ga4\n");
    vElements.addElement("Ga5\n");
    vElements.addElement("Ga6\n");
    vElements.addElement("Ga7\n");
    vElements.addElement("ha1\n");
    vElements.addElement("ia1\n");
    vElements.addElement("ja1\n");
    vElements.addElement("ka1\n");
    vElements.addElement("la1\n");
    vElements.addElement("ma1\n");
    vElements.addElement("na1\n");
    vElements.addElement("oa1\n");
    vElements.addElement("pa1\n");
    vElements.addElement("qa1\n");
    vElements.addElement("ra1\n");
    vElements.addElement("sa1\n");
    vElements.addElement("ta1\n");
    vElements.addElement("ua1\n");*/
    }
    disp = Display.getDisplay(this);
    }

    protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
    // TODO Auto-generated method stub

    }

    protected void pauseApp() {
    // TODO Auto-generated method stub

    }

    protected void startApp() throws MIDletStateChangeException {
    populateForm();
    }

    private void populateForm() {
    form.append(tf);

    for (int k = 0; k < vElements.size(); k++) {
    form.append((String) vElements.elementAt(k));
    }
    form.setItemStateListener(this);
    disp.setCurrent(form);
    }

    public void itemStateChanged(Item arg0) {
    if (arg0 instanceof TextField) {
    String label = ((TextField) arg0).getLabel();

    System.out.println("running here----1");
    if (label.equals("Search")) {
    String strCurrentValue = ((TextField) arg0).getString();

    Vector filteredBrandVec = filter(strCurrentValue, vElements);
    try {
    showElements(filteredBrandVec);
    } catch (Exception ex) {
    ex.printStackTrace();
    }

    }
    }
    }

    private void showElements(Vector filteredBrandVec) {
    for (int count = 1; count < form.size(); count++) {
    form.delete(count);
    count = count - 1;
    }
    form.append(tf);
    form.setItemStateListener(this);
    for(int j=0;j<filteredBrandVec.size();j++){
    form.append((String)filteredBrandVec.elementAt(j));
    }

    }

    public Vector filter(String str, Vector data) {
    Date sdate = new Date();
    long startTime = sdate.getTime();

    Vector tempData = new Vector();
    String tempBrandId;
    String tempBrandName;
    int length = data.size();
    for (int j = 0; j < length; j++) {
    // tempBrandId = (String) data.elementAt(j);
    tempBrandName = (String) data.elementAt(j);
    if (tempBrandName.toLowerCase().startsWith(str.toLowerCase())) {
    // tempData.addElement(tempBrandId);
    tempData.addElement(tempBrandName);
    }
    // j = j + 1;
    }

    return tempData;
    }

    }

  6. #6
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: KeyPad showing up Secondary value rather than primary value

    Quote Originally Posted by Srikanthklkrn View Post
    but this code doesn gimme the issue
    Sorry, you mean this code does not show the same problem that you see with your app?

    You need some code that does show the same problem. This will give three benefits:

    1. In doing so, you'll probably work out what causes the problem
    2. You'll have an example other people can try
    3. We'll have a simpler piece of code to help us figure out a workaround (if one exists)

Similar Threads

  1. Capturing primary and secondary cameras simultaneously
    By cristian.canton in forum Symbian Media (Closed)
    Replies: 8
    Last Post: 2009-06-26, 07:15
  2. App Not Showing when keypad lock
    By sumit.rathi in forum Symbian User Interface
    Replies: 2
    Last Post: 2009-02-04, 07:50
  3. Primary and Secondary DNS for GPRS settings
    By kick121 in forum General Messaging
    Replies: 1
    Last Post: 2003-06-05, 14:22

Posting Permissions

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