Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
Developer
Posts: 141
Registered: ‎08-06-2008
My Device: Not Specified
Accepted Solution

Can not edit in the field...

Hi all,

 

I have coded some simple examples for field and checkbox but some how it is not editable.

I just followed with an example.

Can anyone help me on this?

 

Code is below.

 

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.heycosmo.MyConcierge;

import net.rim.device.api.system.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.ui.FieldChangeListener;
//import com.heycosmo.MyConcierge.ConnectionThread;


/**
 *
 * @author bestway
 */
public class MyScreen extends MainScreen //implements  KeyListener
{

    public Bitmap logoBitmap            = null;
    private final int MAX_EMAIL_NAME    = 60;
    private final int MAX_PASSWD        = 20;
    private ConnectionThread connThread;

    public  AutoTextEditField   emailTextField = new AutoTextEditField("Email: ", "");
    public  BasicEditField      passwdTextField = new BasicEditField("Password: ", "", MAX_PASSWD, BasicEditField.EDITABLE);
    private CheckboxField       rememberMe  = new CheckboxField("Remember me", true);
    private CheckboxField       signAuto    = new CheckboxField("Sign in automatically", true);
    private ButtonField         btnLogin    = new ButtonField("Login",/* Field.FOCUSABLE */ButtonField.FIELD_HCENTER | ButtonField.CONSUME_CLICK);
    private BitmapField         btmField            = null;
   
    public MyScreen(ConnectionThread connThread)
    {
        this.connThread = connThread;
       
        logoBitmap = Bitmap.getBitmapResource("login-img.png");
             
        add(new LabelField("MyConcierge", LabelField.NON_FOCUSABLE | LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH));
        //LabelField title = new LabelField("MyConcierge", LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH );
        //setTitle(title);
       
          
        btmField    = new BitmapField(logoBitmap);
       
        add(btmField);
       
        add(emailTextField);
        add(passwdTextField);
       
        add(new SeparatorField());
        add(rememberMe);
        add(signAuto);
       
        FieldListener sendListener = new FieldListener();
        btnLogin.setChangeListener(sendListener);
        add(btnLogin);       
        //add the main vertical manager to the screen
              
        //add key and trackwheel listeners to the screen
        //addKeyListener(this);
        //addTrackwheelListener(this);
       
               
    }

 

Developer
Posts: 141
Registered: ‎08-06-2008
My Device: Not Specified

Re: Can not edit in the field...

THis problem is solved.

I removed public boolean keyChar(char key, int status, int time)  in the class.