BasicEditField and FILTER_EMAIL

Style BasicEditField.FILTER_EMAIL for EditField and BasicEditField doesn't seem to work as indicated (you can type characters that is not valid for an e-mail address as the space).

Other style filters work very well as EditField.FILTER_UPPERCASE or EditField.FILTER_NUMERIC.

I solved my problem by using EmailAddressEditField instead of EditField or BasicEditField.

However, my question is:-is this a bug in the documentation of the api RIM or am I missing something?

Spaces are allowed when using an EmailAddressTextFilter.  Since the JavaDocs:

This filter accepts all characters except control characters, delimiters, and unwise characters (see RFC 2396). Note, however, it does allow spaces. This is because some corporate email systems use email address in the form "firstname lastname".

Tags: BlackBerry Developers

Similar Questions

  • Focus BasicEditField and buttons problem

    Objective:

    -------------------------------------

    To develop Blackberry app without sequence of focus problem when using the BB with trackpad

    The problem:

    --------------------------------------

    I have 5 BasicEditFields and 5 buttons. All objects are aligned vertically. When I move the finger on the trackpad, update doesn't move from one BasicEditField to another, some are fried, and this happens also with buttons, for example, when the focus is on the first button in the row, and then for some reason when I move the finger on the trackpad button next emphasis is not the one below , but attention "jumps" to the last button. Is possible to set 'order of sequence focus' or something like that?

    If you have Blacberry with touchscreen is not a problem, but if develop you some app for example BB Curve 9360 which has only trackpad, so you cannot select all items.

    Software used:

    ------------------------------------

    Eclipse SDK Indigo version 3.7.2.

    BlackBerry Java plug-in 1.5.0.201112201607

    Operating system:

    -------------------------------------

    Win7 64 bit

    Well, I have the solution

    Don't know why it works, but it does.

    I did two things:

    1.)

    I replaced .add with insert and then add Index numbers

    2.)

    This added to the code:

    protected boolean navigationMovement (int dx, int dy, int, int time status) {}
    Returns false;
    }

    I tried without step 2). but then focus jump bad, in any case, it now works as it should.

    Thank you all for your time and your suggestions.

  • Problem with BasicEditField and predictive text

    What can I do for remove predictive text in a BasicEditField programmatically, as the search for address book entry?

    I think that I can't do with the code, allowing only multitap in the context menu, but the user has seen the AddressBook and want the same thing.

    Thanks in advance.

    And this one:

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=11522&query.ID=23...

  • Calculation of the minimum required size for a BasicEditField

    Hello

    I hope someone can help! This is continued in another post, I had about resize a BasicEditField so I could put a button on the same line.

    I re-size my BasicEditField to be half the width of the screen. I also set the maximum number of characters which they reached 6. When the user tries to enter the character 7 I get an alert that the field is full. I have a border around the BasicEditField and the user, it seems they should be able to enter more characters that is to say the space to enter the number is much larger than 6 characters.

    Does anyone know a way to calculate the size so the domain will be the right size it of to say to fit to the label and up to 6 characters, but not bigger?

    I hope I've explained this well enough to understand. Thanks in advance for any help

    Just put a code here:

    http://supportforums.BlackBerry.com/T5/Java-development/please-help-with-trying-to-put-a-BasicEditFi...

  • VirtualKeyboard and fields

    The Storm, should the virtual keyboard automatically appears when a text entry field is centered?  Should the virtual keyboard will disappear if any other field is concentrated?

    I have a screen with a BasicEditField and an ObjectChoiceField.  If the BasicEditField is the first field on the screen, the virtual keyboard gets displayed when the screen is pushed on the stack.  If I concentrate the ObjectChoiceField, the virtual keyboard remains on the screen.

    If the ObjectChoiceField is the first, the virtual keyboard does not appear when the screen is pressed.  If I concentrate the BasicEditField, the virtual keyboard does not appear.  I choose show keyboard on the menu to see it.

    Should not the virtual keyboard automatically appears based on the ground?  Otherwise, what is the good work around?  Should I really decide if each of my fields need a keyboard and then show and hide in onFocus?

    It's on a Storm 9530-4.7.0.148.

    Thank you.

    The virtual keyboard will be displayed automatically.  I was able to reproduce it and handed the issue to our development team.  Thanks for reporting this!

    To work around the problem, you can manually display the virtual keyboard.

  • Capture the Keycodes / keyDown in BasicEditField with digital filter

    I tried to understand cela other posts and the API, but I can't seem to get it.

    I created a BasicEditField and applied a filter TextFilter so that it can accept only digital entries. It is the substitution of the event keyDown as expected, but I can not just to capture "1,2,3,4,5,6,7,8,9,0" - he used ' enter my conditional statements - which of course means that the controls do not work.

    I tried the keycodes of compairing the raw numbers, converted characters, KEY_NUM2 and basically everything that was suggested, but I'm obviously missing something.

       BasicEditField numEnter = new BasicEditField()    {     protected boolean keyDown(int keycode, int time)      {             int key = Keypad.key(keycode);                //char key = (char) Keypad.key(keycode);              //this.setText(Integer.toString(key));
    
              //if (key == Characters.DIGIT_ONE)            //if (keycode == 570163217)               if (key == 01)                {                                 this.setText("ONE");              }             else if (keycode == 45219842)             {                                 this.setText("TWO");              }
    
              return false;     } };
    
      // set the filter numEnter.setFilter(TextFilter.get(TextFilter.NUMERIC));
    
     // add to field manager   hfm_logo.add(numEnter);
    

    As always, your help is always appreciated.

    Well...

    It is the solution that I came. Don't know if it's fair, but it seems to work.

    Basically, with the NumericFilter codes keyboard is the same as if you have the filter applied or not to the text box, so even if you override the keydown it doesn't matter if you're trying to intercept him because he gives you the key you pressed on, not what appear after the filter.

    That being said, if you try to do this in the keyDown as you cannot capture because the character needs to be painted on the screen first, otherwise you get an error happens nowhere. So if you paint the screen first and then take some text is located in the numEnter, then put it to white even once, you can capture the NUMBERS that are entered (forcably) on each keyboard phone.

    Tested with:

    9000

    8110

    8820

    8800

    8300

    Should work with anything 4.2.0 + JDE

     EditField numEnter = new EditField()
        {
    
            protected void paint(Graphics graphics)
            {
                super.paint(graphics);
    
                if (this.getText().length() > 0)
                {
                    switch (this.getText().charAt(0))
                    {
                    case Characters.DIGIT_ONE:
                        text.setText("DIGIT_ONE");
                        break;
                    case Characters.DIGIT_TWO:
                        text.setText("DIGIT_TWO");
                        break;
                    case Characters.DIGIT_THREE:
                        text.setText("DIGIT_THREE");
                        break;
                    case Characters.DIGIT_FOUR:
                        text.setText("DIGIT_FOUR");
                        break;
                    case Characters.DIGIT_FIVE:
                        text.setText("DIGIT_FIVE");
                        break;
                    case Characters.DIGIT_SIX:
                        text.setText("DIGIT_SIX");
                        break;
                    case Characters.DIGIT_SEVEN:
                        text.setText("DIGIT_SEVEN");
                        break;
                    case Characters.DIGIT_EIGHT:
                        text.setText("DIGIT_EIGHT");
                        break;
                    case Characters.DIGIT_NINE:
                        text.setText("DIGIT_NINE");
                        break;
                    case Characters.DIGIT_ZERO:
                        text.setText("DIGIT_ZERO");
                        break;
                    }
    
                    this.setText("");
                }
            }
        };
    
  • ButtonField and LabelField layout

    Hello

    IM using a manager of horizontal field for the bottom of the screen, I want to achieve the following with the components, but find this thing, they end by the other side.

    -----------------------------------------------

    [Label]               [Label]           [button

    [TextField]         [TextField]

    -----------------------------------------------

    I also have a problem where when I use the Simulator for the storm when I use the button once and then I get the menu, can I dissable it somehow?

    MC2011 wrote:

    Hello

    I'm having a small problem trying to place two BasicEditFields next to each other, it seems that only one is visible, even though I have replace their preferredWidth 30, horizontal screen Manager has more than 60 width.

    Is it also possible to put the label of the BasicEditField above the area of text as follows:

    Label

    [entry]

    Rather than:

    Label [entry]

    For the explanation of BasicEditField and an example of how to fight that, see this post:

    EditField and checkboxfield on the same line

    All said on being greedy width EditField also applies to the BasicEditField.

    Put the label on top of the entrance area is achieved very easily: Add a label without EditField and a LabelField to a VerticalFieldManager and you will get the result.

  • Click on the button to see the ListField

    Hi all
    Please help... I don't know what the problem
    I have two problems.
    I have the screen where BasicEditField and ButtonField... If I click Show me so ListField.

    Here is my source code...

    package com.screen;
    
    import java.util.Vector;
    import com.stepan.kutaj.bbmsearch.util.CustomListField;
    import com.stepan.kutaj.bbmsearch.util.ListRander;
    import net.rim.device.api.system.Bitmap;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.MenuItem;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.XYEdges;
    import net.rim.device.api.ui.component.BasicEditField;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.container.HorizontalFieldManager;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    import net.rim.device.api.ui.decor.BackgroundFactory;
    import net.rim.device.api.ui.decor.BorderFactory;
    
    public class Test extends MainScreen
    {
        private BasicEditField enterSearch;
        private ButtonField btnSearch;
        private String txtMenuAbout = "About";
        private Vector info = new Vector();
        private CustomListField myListView;
        private String Name;
        private Bitmap displayPicture = Bitmap.getBitmapResource("rounded.png");;
    
        public Test()
        {
            super(MainScreen.VERTICAL_SCROLL | MainScreen.VERTICAL_SCROLLBAR);
    
            addMenuItem(_viewAboutMenu);
    
            this.getMainManager().setBackground(BackgroundFactory.createSolidBackground(0x00e5e5e5));
    
            Bitmap borderBitmap = Bitmap.getBitmapResource("rounded.png");
    
            VerticalFieldManager m = new VerticalFieldManager(MainScreen.NO_VERTICAL_SCROLL);
            m.setBorder(BorderFactory.createBitmapBorder(new XYEdges(12,12,12,12), borderBitmap));
    
            HorizontalFieldManager h = new HorizontalFieldManager(MainScreen.NO_VERTICAL_SCROLL);
    
            enterSearch = new BasicEditField("Search : ", "");
            btnSearch = new ButtonField("Search");
            btnSearch.setChangeListener(buttonListener);
            h.add(enterSearch);
    
            m.add(h);
            add(m);
            add(btnSearch);
    
        }
    
        public boolean onClose() {
            System.exit(0);
            return true;
        }
    
        private MenuItem _viewAboutMenu = new MenuItem(txtMenuAbout, 10, 20)
        {
           public void run()
           {
               UiApplication.getUiApplication().pushScreen(new AboutScreen());
           }
        };
    
        FieldChangeListener buttonListener = new FieldChangeListener()
        {
            public void fieldChanged(Field field, int context)
            {
                if (field == btnSearch)
                {
                    Bitmap borderBitmap = Bitmap.getBitmapResource("rounded.png");
                    VerticalFieldManager s = new VerticalFieldManager(MainScreen.NO_VERTICAL_SCROLL);
                    s.setBorder(BorderFactory.createBitmapBorder(new XYEdges(12,12,12,12), borderBitmap));
    
                        for(int in = 0; in < 4; in++)
                        {
                            Name = "Name" + in;
    
                            String listTitle = Name;
                            String listDesc = "Description: ";
                            String listDesc2 = "Desc: ";
    
                            info.addElement(new ListRander(displayPicture, listTitle, listDesc, listDesc2));
                        }
    
                    myListView = new CustomListField(info)
                    {
                        protected boolean trackwheelClick (int status, int time)
                        {
                            Dialog.alert(" Selected :" + Name);
                            return super.trackwheelClick(status, time);
                        }
                    };
    
                    s.add(myListView);
                    add(s);
                }
            }
        };
    }
    

    and my problem is when I click on the button that show me ListField and context menu... and I do not know how to disable the context menu open...

    second problem is:
    in this list I generated 4 rows with unique name

    for(int in = 0; in < 4; in++)
    {
    Name = "Name" + in;
    
    String listTitle = Name;
    String listDesc = "Description: ";
    String listDesc2 = "Desc: ";
    
    info.addElement(new ListRander(displayPicture, listTitle, listDesc, listDesc2));
    }
    

    and I want to click on line, so I have to show for this specific line name...

    myListView = new CustomListField(info)
    {
        protected boolean trackwheelClick (int status, int time)
        {
           Dialog.alert(" Selected :" + Name);
           return super.trackwheelClick(status, time);
        }
    };
    

    and I have problem of course that shows me all name lines generated only modified (for example name03).

    can you help me please?

    Thank you

    Stepan

    (1) change

    btnSearch = new ButtonField ("Search");

    TO

    btnSearch = new ButtonField ("Search", ButtonField.CONSUME_CLICK);

    (2) I would have thought that you want something like

    protected boolean trackwheelClick (int status, int time)
    {
    ListRander selectedLine = (ListRander0 (this.getSekectedIndex ()) info.elementAt;

    String name = selectedLine.getName ();

    Dialog.Alert ("Selected:" + name);
    Return super.trackwheelClick (status, time);
    }

  • Set the then visible invisible field

    This may seem a stupid question, but I can't get this to work! I want to add a field... lets say a BasicEditField and it is invisible at the moment when it is added. Click a button set the visible editField! How to do this please?

    you add the field when you want it to be visible.

  • Storm2 keyChar do not capture alphabets

    Hi all

    I use JDE 4.7 and have peripheral storm2.

    I've added a basic keyChar to BasicEditField and ovrride inside.

    A weird behavior occurs both complete and reduce the keyboard.

    keyChar is capture of ENTRY ('\n'), return BACK and PERIOD ('. ') but its the whole alphabet press capture.

    Behavior occurs on the device and Simulator.

    Can someone tell me why or if there is a solution for this?

    After the upgrade modules devices and Simulator, I don't have this problem.

    The guys from RIM is the expected behavior?

  • Put two ObjectChoiceField side by side

    Hello

    I tried to put both components in a HorizontalFieldManager ObjectChoiceField, but I can't view both on the same line, it seems that the other is pushed off the screen to the right.

    I tried with Manager.NO_HORIZONTAL_SCROLL nothing works.

    Can anyone please help me;

    Thank you very much

    You can limit the width of one of them. These two talk on this subject, but for the different types of fields:

    http://supportforums.BlackBerry.com/T5/Java-development/can-t-put-BasicEditField-and-button-side-by-...

    http://supportforums.BlackBerry.com/T5/Java-development/please-help-with-trying-to-put-a-BasicEditFi...

    But if you are sure that they will hold next, you can set one on the left with the style

    Field.FIELD_LEFT and I think he'll try to stay as close to the left as it can.  Give it a try.

  • NullPointerException: moveFocusToFieldWithInput

    I'm running in an intermittent Ref null exception using the Simulator 6.0.0.246 & 6.0.0.337 9800 Torch generic.

    It happens that I drag in the space of a VerticalFieldManager which contains 2 fields or more active (for example, a BasicEditField and a PasswordEditField). For me, it looks like this method, moveFocustToFieldWithInput try to pick the closest focusable field where the user is drag and give the focus to this field.

    Here's the exception stack trace (code RIM all):

    Java Exception data
     NullPointerException
     No detail message
     net_rim_cldc-13(4C94D16C)
     Manager
     moveFocusToFieldWithInput
     0x8D0A
     net_rim_cldc-14(4C94D16C)
     Screen
     moveFocusToFieldWithInput
     0x294F
     net_rim_cldc-14(4C94D16C)
     Screen
     dispatchTouchEvent
     0x2BF4
     net_rim_cldc-15(4C94D16C)
     UiEngineImpl
     processMessage
     0x6BC8
     net_rim_cldc-9(4C94D16C)
     Application
    
     0x2CBE
     net_rim_cldc-9(4C94D16C)
     Application
     processNextMessage
     0x1BEA
     net_rim_cldc-9(4C94D16C)
     Application
     enterEventDispatcher
     0x1B0F
    

    It is quite easy to reproduce on the Simulator, but I can't reproduce it on a real device.

    I was wondering:

    1A anyone had this problem before and if so what did they do to solve

    2 do you have any suggestions on how to intercept this exception

    3 do you have any ideas on what is the source of the problem

    Thanks in advance.

    Thanks for your reply Mark, thank you for taking a look at this.

    What follows is an application of 1 screen which reproduce this bug but also identifies what can be done to hide the bug (concealment however is hardly a real solution).

    There are comments that describe how to reproduce the bug, but here they are outside of the code:

    1. Run the following application on a Torch 9800 Simulator (I tried two 6.0.0.246 and 6.0.0.337)
    2. Ensure the focus is in the area of the editor 'user_name '.
    3. Tap the screen just below the label of "Password".
      • touch under the password field properly sets focus to the field
      • ensure that you tap outside the limits of the label (which has an aqua background
      • ensure that you hit the limits of the RowManager (identified by color biscuite)

    You can also reproduce this bug by:

    1. Run the following application on a Torch 9800 Simulator (I tried two 6.0.0.246 and 6.0.0.337)
    2. Ensure the focus is in the area of the editor "Password."
    3. Tap the screen just below the label "Username".
      • area affecting as the user properly sets focus the field
      • ensure that you tap outside the limits of the label (which has an aqua background color)
      • ensure that you hit the limits of the RowManager (identified by color biscuite)

    Notes:
    In this case, this bug can be 'hidden' by ensuring that the RowManager.getPreferredHeight returns the maximum value of the field's highest - by doing this that you make it impossible for the user to click below the label

    package ca.focuserrorapp;
    
    import net.rim.device.api.system.Display;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.Manager;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.XYEdges;
    import net.rim.device.api.ui.component.BasicEditField;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.component.PasswordEditField;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    import net.rim.device.api.ui.decor.BackgroundFactory;
    
    /*
     * Steps to reproduce the bug described here: http://supportforums.blackberry.com/t5/Java-Development/NullPointerException-moveFocusToFieldWithInp...
     *
     *  1. Launch the following application on a Torch 9800 simulator (I've tried both 6.0.0.246 and 6.0.0.337)
     *  2. Ensure focus is in the 'Username' editor field
     *  3. Touch the screen just below the 'Password' label
     *     - touching below the password field correctly assigns focus to the field
     *     - ensure you touch outside the bounds of the label (which has an aqua background color)
     *     - ensure you touch inside the bounds of the RowManager (identified by the bisque color)
     *
     *  You can also reproduce this bug by:
     *  1. Launch the following application on a Torch 9800 simulator (I've tried both 6.0.0.246 and 6.0.0.337)
     *  2. Ensure focus is in the 'Password' editor field
     *  3. Touch the screen just below the 'Username' label
     *     - touching below the username field correctly assigns focus to the field
     *     - ensure you touch outside the bounds of the label (which has an aqua background color)
     *     - ensure you touch inside the bounds of the RowManager (identified by the bisque color)
     *
     * Notes:
     *
     * In this case, this bug can be "hidden" by ensuring the RowManager.getPreferredHeight returns the max
     * value of it's tallest field - by doing this you make it impossible for the user to click below the label
     *
     */
    
    public class FocusErrorApp extends UiApplication {
      public static void main( String[] args ) {
    
        FocusErrorApp app = new FocusErrorApp();
        app.enterEventDispatcher();
      }
    
      public FocusErrorApp() {
    
        this.pushScreen(new TestScreen());
      }
    
      static final class TestScreen extends MainScreen {
        public TestScreen() {
    
          super();
    
          this.setTitle("Focus error test application");
    
          this.initLayout();
        }
    
        protected void initLayout() {
    
          int containerWidth = 250;
          int containerHMargin = (Display.getWidth() - containerWidth) / 2;
          VerticalFieldManager uxLoginContainer = new VerticalFieldManager();
          uxLoginContainer.setMargin(new XYEdges(0, containerHMargin, 0, containerHMargin));
    
          BasicEditField uxUsername = new BasicEditField("", "", 50, BasicEditField.USE_ALL_WIDTH
              | BasicEditField.NO_NEWLINE | BasicEditField.NO_LEARNING | BasicEditField.NON_SPELLCHECKABLE
              | BasicEditField.NO_COMPLEX_INPUT);
    
          PasswordEditField uxPassword = new PasswordEditField("", "", 50, PasswordEditField.USE_ALL_WIDTH);
    
          uxLoginContainer.add(new RowManager("Username", uxUsername));
          uxLoginContainer.add(new RowManager("Password", uxPassword));
    
          this.add(uxLoginContainer);
        }
    
        private class RowManager extends Manager {
    
          private final LabelField uxLabel;
          private final Field uxEditor;
    
          public RowManager( String label, Field editor ) {
    
            super(Manager.USE_ALL_WIDTH);
            this.uxLabel = new LabelField(label);
            this.uxLabel.setBackground(BackgroundFactory.createSolidBackground(Color.AQUA));
            this.uxEditor = editor;
            this.uxEditor.setBackground(BackgroundFactory.createSolidBackground(Color.GREENYELLOW));
    
            this.setBackground(BackgroundFactory.createSolidBackground(Color.BISQUE));
    
            this.add(this.uxLabel);
            this.add(this.uxEditor);
          }
    
          public int getPreferredWidth() {
    
            return Display.getWidth();
          }
    
          public int getPreferredHeight() {
    
            return 50;//Math.max(this.uxLabel.getPreferredHeight(), this.uxEditor.getPreferredHeight());
          }
    
          protected void sublayout( int arg0, int arg1 ) {
    
            this.setPositionChild(this.uxLabel, 0, 0);
            this.layoutChild(this.uxLabel, 150, this.uxLabel.getPreferredHeight());
    
            this.setPositionChild(this.uxEditor, 155, 0);
            this.layoutChild(this.uxEditor, 150, this.uxEditor.getPreferredHeight());
    
            super.setExtent(this.getPreferredWidth(), this.getPreferredHeight());
          }
        }
      }
    }
    
  • HorizontalFieldManager in a DialogFieldManager

    Hi I'm trying to place a HorizontalFieldManager that contains a BasicEditField and a ButtonField in a DialogFieldManager.  When I run the code below in the HorizontalFieldManager fields do not appear.

    DialogFieldManager dfm = (DialogFieldManager)getDelegate();
             dfm.setIcon(new BitmapField(Bitmap.getPredefinedBitmap(Bitmap.QUESTION)));
             dfm.setMessage(new RichTextField("Select a text file for results"));
    
            _txtfilename = new BasicEditField() {
                protected void paint(Graphics g) {
                    if (getTextLength() == 0) {
                        g.setColor(0x00a0a0a0);
                        g.drawText("Enter Text File Name", 0, 0);
                    }
                    g.setColor(0xF5F5F5);
                    super.paint(g);
                }
            };
            _txtfilename.setBorder(BorderFactory.createSimpleBorder(new XYEdges(2, 2, 2, 2), 0xF5F5F5));
            _btnOK = new ButtonField();
             HorizontalFieldManager hfm = new HorizontalFieldManager()
             {
                 public void sublayout(int width, int height) {
                      int xpos = 0;
                      int ypos = 0;
                      Field field = getField(0);
    
                      setPositionChild(field, xpos, ypos);
                      layoutChild(field, 280, 50);
    
                      Field field1 = getField(1);
    
                      setPositionChild(field1, xpos+20, ypos+80);
                      layoutChild(field1, 100, 50);
    
                      setPosition(150, 220);
                      setExtent(width, height);
                 }
             };
             hfm.add(_txtfilename);
             hfm.add(_btnOK);
             dfm.add(hfm);
    
            _olf = new ObjectListField();
            dfm.addCustomField(_olf);
            updateList(path);
            _txtfilename.setFocus();
    

    Any help would be greatly appreciated.

    Thank you.

    According to my interpretation of the Javadocs, instead:

    DFM. Add (HFM);

    you will need

    dfm.addCustomField (hfm);

    have you tried that?
    :

  • Question of the screen of the user interface

    Hello guys '

    I draw the screen for my application. This screen has LabelField, BasicEditField and RichEditField.

    You can see on the image which screen I want to draw.

    Constant stable position in these fields. I don't know how to scroll through RichTextField.

    If you have an idea, please help me.

    Good day. TNX all

    Take a look at the BlackBerry Developer journal article below.  It shows how to create a custom behavior field you are looking for.

    http://NA.BlackBerry.com/eng/developers/resources/journals/jul_2005/creating_textbox_field.jsp

  • Validation does not work

    Hello world

    There is a login screen that contains (basiceditfield) username, Password (basiceditfield) and submit (buttonfield)...  If the user name and password is equal to "AEK" then only it may be able to go to the next screen by clicking on submit button... the next screen contains the user name and password, that he entered the first screen... but my validation does not work... it shows that the user name and password dialog box is wrong... just see this as soon as it takes a few minutes.. Please check it out...  my code is

    Import net.rim.device.api.system.Bitmap;

    Net.rim.device.api.ui import. *;

    Net.rim.device.api.ui.component import. *;

    Net.rim.device.api.ui.container import. *;

    SerializableAttribute public class extends UiApplication LoginScreen

    {

    Public Shared Sub main (String [] args)

    {

    LoginScreen connection = new LoginScreen();

    login.enterEventDispatcher ();

    }

    public LoginScreen()

    {

    pushScreen (new login()));

    }

    }

    final class login extends screen

    implements FieldChangeListener

    {

    DisplayList _displayList;

    HorizontalFieldManager _fieldManagerTop = new HorizontalFieldManager();

    VerticalFieldManager _fieldManagerMiddle = new VerticalFieldManager();

    HorizontalFieldManager _fieldManagerBottom = new HorizontalFieldManager();

    public BasicEditField username = new EditField("Username:","",8,EditField.FILTER_DEFAULT);

    password public PasswordEditField = new PasswordEditField("Password:","",8,EditField.FILTER_DEFAULT);

    ButtonField submit = new ButtonField ("Submit");

    ButtonField cancel = new ButtonField ("Cancel");

    BitmapField bitmapfield;

    Bitmap flag;

    LabelField label = new LabelField("",)

    LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);

    public login())

    {

    Super();

    for listener btn

    LabelField title = new LabelField ("HelloWorld example",

    LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);

    setTitle (title);

    Flag = bitmap.getBitmapResource ("TLI.png");

    bitmapfield = new BitmapField();

    bitmapfield.setBitmap (flag);

    Add (_fieldManagerTop);

    Add (new SeparatorField());

    Add (_fieldManagerMiddle);

    Add (new SeparatorField());

    Add (label);

    Add (new SeparatorField());

    Add (new SeparatorField());

    Add (_fieldManagerBottom);

    _fieldManagerTop.Add (bitmapfield);

    _fieldManagerMiddle.Add (username);

    _fieldManagerMiddle.Add (Password);

    submit.setChangeListener (this);

    cancel.setChangeListener (this);

    Add (new SeparatorField());

    _fieldManagerBottom.Add (Submit);

    _fieldManagerBottom.Add (cancel);

    }

    ' Public Sub fieldChanged (field f, int context)

    {

    if(f==Submit)

    {

    System.out.println("username:\n"+username. GetText () + "\npassword:" + password. GetText());

    System.out.println ("Submit");

    If (username. Equals("Abhi") & password.equals ("abhi"))

    {

    _displayList = new DisplayList();

    UiApplication.getUiApplication () .pushScreen (_displayList);

    }

    on the other

    {

    System.out.println ("invalid entries");

    Dialog.Alert ("Invalid username and password");

    }

    _displayList = new displayList();

    UiApplication.getUiApplication () .pushScreen (_displayList);

    }

    Another yew (f is cancel)

    {

    System.out.println ("Cancel");

    username.setText("");

    password.setText("");

    }

    }

    SerializableAttribute public class screen extends DisplayList

    {

    RichTextField username, password;

    public DisplayList()

    {

    Super();

    The screen of sc = new FullScreen();

    userName = new RichTextField (username.getText ());

    password = new RichTextField (password.getText ());

    TCI Add (username);

    TCI Add (Password);

    UiApplication.getUiApplication () .pushScreen (sc);

    }

    }

    }

    Have you tried this one in the if loop?

    If (username. GetText () .equalsIgnoreCase ("Abhi") & {password.getText (.equalsIgnoreCase ("abhi")))}

    }

Maybe you are looking for