Implementation of the text box

Hello

I need to put in place the text box in my application. I have created custom textbox his works well, enter when the button I get no second line, but the focus moves to the next field. Please

class TextBox extends VerticalFieldManager {
    int managerWidth;
    int managerHeight;
    private EditField editField;

    int width = Display.getWidth()-70;
    int height = 18;
    int maxvalue=2000;
    public TextBox() {
        super(Manager.NO_VERTICAL_SCROLL);
        managerWidth = width;
        managerHeight = height;
        VerticalFieldManager vfm = new VerticalFieldManager(Manager.VERTICAL_SCROLL |               VerticalFieldManager.FIELD_VCENTER);
        // vfm.setPadding(3,0,0,5);
        editField = new EditField("","",maxvalue,Field.FIELD_HCENTER){
            public void paint(Graphics g) {
                getManager().invalidate();
                this.setFont(Utilities.getAppFont());
                super.paint(g);
            }
        };
        vfm.add(editField);
        add(vfm);
    }
    public void paint(Graphics graphics) {
        graphics.setColor(Color.WHITE);
        graphics.fillRoundRect(0, 0, getWidth(), getHeight(), 10, 10);
        graphics.setColor(0x00000000);
        super.paint(graphics);
        graphics.setColor(0x0BBBBBB);
        graphics.drawRoundRect(0, 0, getWidth(), getHeight(), 10, 10);
    }
    public void sublayout(int width, int iHeight) {
        if (managerWidth == 0) {
            managerWidth = width;
        }
        if (managerHeight == 0) {
            managerHeight = iHeight;
        }
        super.sublayout(managerWidth, managerHeight);
        int iNumFields = getFieldCount();
        int iYPos = 5;
        int iXPos = 5;
        Field fField = null;

        for (int i = 0; i < iNumFields; i++) {
            fField = this.getField(i);
            setPositionChild(fField, iXPos, iYPos);
            //get height for layout and height
            int tmpHeight = managerHeight;
            //draw field
            layoutChild(fField, getWidth(), tmpHeight);
            iYPos = iYPos + tmpHeight+5;
        }
        //now we reset our extent to include padding   

        this.setExtent(managerWidth, Math.max(iYPos, getPreferredHeight()));
        setVirtualExtent(managerWidth, Math.max(iYPos, getPreferredHeight()));
    }
    public int getPreferredHeight() {
        height = 5;
        int iNumFields = getFieldCount();
        for (int i = 0; i < iNumFields; i++) {
            height += getHeight(getField(i))+5;
        }
        return height;
    }

    private int getHeight(Field f) {
        return Math.max(Math.max(f.getContentHeight(), f.getHeight()),f.getPreferredHeight());
    }
    public String getText() {
        return editField.getText();
    }
    public void setText(String text) {
        editField.setText(text);
    }
    public void setMaxSize(int max) {
        editField.setMaxSize(max);
    }  

}

Help me create the text box

Sorry not looked seriously at your code, but there are some problems with it I think.

Rather than trying to fix your code, it does the job for you?

http://supportforums.BlackBerry.com/T5/Java-development/TextBoxField-revisited/Ta-p/548410

Tags: BlackBerry Developers

Similar Questions

  • Update of dynamic Action with the text box

    This goes along with: update records with the text box

    APEX: 4.0.2

    THEME: SAND

    SERVER: Oracle-Application-Server-10g/10.1.3.1.0 Oracle-HTTP-Server

    I created an example with more comments on the page:

    workspace: stevendooley34

    username: dev01

    password: dev01

    application: examples of Forum

    page: update example

    I've implemented just as I think it should be put in place, but records only updates by clicking on my Refresh"" button.

    Keep in mind that the example is found in the apex 4.2.5 but I will implement this in 4.0.2.

    Thank you

    Steven



    Hi Steven,

    I think the main thing that was missing was adding the elements used in the PL/SQL "Page to go".

    The reason this is necessary is so APEX know what values of point on the browser should be sent (as part of the AJAX call) to the browser.

    IF you had all the elements that must be returned to the screen, then you will use the 'Page field items to return.

    I've also corrected a few things, P6 instead of P6 and P6_SEARCH_TYPE instead of SEARCH_TYPE, but they were just small "bugs" in the example.

    I also added another real action to refresh the report after the update.

    Thank you

    -Jorge

    PS. I do not validate that your code works for multiple, but the first glance entries and a quick test, it seems to work fine.  I focused only on the DA.

  • How to add create box as well as the text box on a form?

    Hi all

    I got the new requirement to create a form.
    In this form, I have an admin section, where
    I need to display the values like this

    [checkbox] admin, specific group [text box to enter text values]

    value will be like this

    1. checked | Admin, specific group | Design Group

    that means that when the user opens the form, it may be able to view five check boxes with text, next text we need to five text boxes, the user must check the box and enter text in the text box so that the data will be saved in the table.
    I need your help to implement this requirement.



    Thank you and best regards,
    Robette.

    >
    I created a form on view/table, just a form. With that I have three sections, the first section is having

    point of the box so that the name of the check box when the user selects the check box, it may be able to enter text in the text box that appear right next to the name of the checkbox element.

    For example.

    CheckBox and Textbox

    >

    Means that it is not a tabular form. Useful information.

    a. you have a Page of Type checkbox element in the Apex to use? It is based on LoV.
    b. you can position the elements of page using drag-and - drop Application Builder, layout is not a problem.
    c. because it is a Page element, you can easily do Validations, calculations, DAs on it.

    So, what's the problem? You should be able to view the page that you want to
    >
    CheckBox and Textbox
    >

    Concerning

  • How to follow the overview of the border of the text box?

    Hi all

    I really need an idea. I use the text box that is mobile. It moves when you drag.

    Now, I want to move only by clicking on the border. If you've seen the text box in powerpoint on that, if you place the cursor on the border it shows a + cursor.

    I would like to implement the same in flex. Does anyone have an idea?

    Thank you

    -CK

    Add a listener to the mouseMove event in the text box.

    ta.addEventListener (MouseEvent.MOUSE_MOVE, onMouseMove);

    private var upperThreshold:int = 5;

    private var lowerThreshold:int = 10;

    private var leftThreshold:int = 3;

    private var rightThreshold:int = 6;

    private void onMouseMove(evt:MouseEvent):void {}

    var isOnBorder:Boolean = false;

    If (your .mouseY<=>

    isOnBorder = true;

    } ElseIf (your .mouseY > = ta.height - lowerThreshold) {}

    isOnBorder = true;

    } ElseIf (your .mouseX<=>

    isOnBorder = true;

    } ElseIf (your .mouseX > = ta.width - rightThreshold) {}

    isOnBorder = true;

    }

    If {(isOnBorder)

    define your styles and watch a mouse down event

    } else {}

    Remove your styles and the mouse to the bottom of the event listener

    }

    }

    In the example above, you also need to listen to a mouse out even so you can delete the styles and the unwanted event listeners.

  • Find the cursor/carat posisition in the text box

    Hey all,.

    I'm new to flex and I am trying to write a function that will give me the index of the position of the cursor in a TextArea, I see that TextField is a getCaratPosition() or something similar. did someone knows how I could find out how to implement that in a box of text... or is there really no difference between a textArea and TextField component and I should just use a field?

    Thanks in advance!

    I think that the simplest here would continue to use the text box, then get the caretIndex of the textfield in the OT:

    var idx:int = TextField (ta.getChildAt (2)) .caretIndex; TA is the id of your TextArea

    Also make sure you import flash.text.TextField.

    TS

  • Reorganization of the text boxes so that they mix upwards or downwards

    Hello

    I'm not sure to understand what happens when the text inline boxes are dragged - I have 6 on a page that are the width of the page but different heights and I would like to re - order them so they mix it up or down depending on where I drag them, but at the moment they go to the bottom of the page or disappear completely I can't work on the behavior.

    I think there must be a way of formatting.

    Thank you

    James

    Select each text box and if you use v5 Pages, visit the reorder menu and text wrapping set to None. Now, the text box are not repellent, and you can position them as you please. If you always use the Pages ' 09 and then again, select each text box and the Wrap Inspector, deselect object causes wrap.

  • You can change the font size using the form in the preview (not with the text box). Having also arrow drawing trouble in preview.

    You can change the font size using the form in the preview (not with the text box). Having also arrow drawing trouble in preview.

    What problems are you having with the arrow? You go to Tools-> annotate-> arrow and an arrow appears. Then you can drag around the head and tail to make it to the desired location.

  • Drag and drop the text box color - pages

    Hello

    I just upgraded from Pages 09 to 5.6 Pages. Pages 09, if I did drag a color from the menu of color on a text box, it might change the color of the text. 5.6 pages this action changes the fill of the text box, not the color of the text. Is it possible to force the behavior of 09 to 5.6? I change the color of the text much more often than the color of the background of the text box.

    Thank you very much!

    Force the behavior of Pages ' 09 v5.6? Absolutely not.

    Pages ' 09 and v5 are entirely different applications and not surprisingly, they work differently also. In the Pages v5, fill, text and a text box border color come from different parts of the application, not a central color palette.

  • the text box changes color when you type in a google search and the cursor and the text becomes invisible.

    When I open Firefox, a cursor appears in the search text box, but I have to click on it before I can enter text. When I click on the text box changes color (from teal'c white to a light color) and the slider and I type text is invisible.

    Which may be caused by protection of typing"Comcast constant guard.

    'Configure the Anti-keylogger settings'-> disable

  • How to enter special characters/symbols (i.e. the degree character) in the text boxes?

    Not a problem/w Firefox - I was wondering if there is a way to enter the special characters and characters (not on the keyboard) in the text boxes? I remember that there is a keyboard sequence that activates a context menu allowing the single character/symbol entry. Thanks in advance, Allan.

    See:

  • How do I enlarge the text box

    I have the latest version of Skype and trying to extend the text box where I write. Now, it seems so small. I know that before you could develop the window moving upwards or downwards according to the needs.

    Someone knows how to do this? Is it still possible?

    http://community.Skype.com/T5/Windows-desktop-client/how-can-I-change-the-height-of-the-input-box-in...

  • When I print a table (multiple pages) the text box under the table seems to be moving under the table and prints with the table of this overlap. My only solution is to push the text box further down the page before printing... Any advice?

    Im having problems shaped a text box so that my table does not print right on top of it. I want it inside of my table (it's 'tems and conditions' budget)

    Any advice would be great.

    I face the same problem as well. Would like to know if there is a better way to get the text box to move with the table instead of the effect that overlap. Have to manually adjust the layout, whenever I want to get a reasonable print of a document (or export it to PDF) seems counterintuitive, especially when it causes the document seem ill-disposed on screen.

    I am running version 3.6.2 of the numbers in the case where that matters.

  • Pages is not track changes inside the text boxes?

    I try to use Pages, industry changes, but it seems to be limited to body text. If I include images deleted, or if I change the text inside the text boxes, no changes are followed. What is a limit? (Version 5.6.1 of pages)

    See this thread for an answer from VikingOSX, the short answer for the current Version is no.

    Pages ' 09 fact.

    Track changes in text boxes

    You could always suggest via Contact us Apple to add this feature in the news

    http://www.Apple.com/feedback/pages.html

  • photo book - move the text box

    I'm building my first photo book project - I was able to choose a theme, add images, open 'options', type in the text box, edit the fonts and size and move the text up and down the text box - BUT I couldn't resize the text box or move it to the lowest point in the page.

    - BUT I was unable to resize the text box or move it to the lowest point in the page-

    Which is not supported. You should choose a layout that is the text box where you want it.

    Click on the Options button in the toolbar, and then select a layout that has a text more large field or to another post.

  • Automatically put the cursor in the text box to start

    Hi guys

    On the picture below you can see a small piece of my FP. It is a part of a bigger FP for a pretty huge electronics test. Each PCB got its own series number of barcode. I have a drive that is connected to my keyboard. Then when I read the code bar, numbers will appear in the text box on my FP, IF i first click on the text box. Then the user must only press START to do the test. My problem, or wish, if you like, is that when the program starts, or a test has completed, the cursor/marker is placed in the text box, so I just have to read bar codes.

    Currently, the user must click in the text box before you read the code bar. Is it possible that this can be done by Labview?

    I n node property checked yet, because I'm busy to something else right now at work. Just write in my break.

    Thanks for any help!

    PS I would have found the answer in the forum, but I am from Norway, and not all of the language of the computer is easy to translate since I use windows Norwegians. I belive that it is called cursor or marker however.

    Kind regards

    Even

    Hello

    The property node "KeyFocus" attached here brings the cursor automatically in the text box.  Set the "Val (Sgnl)" blank to trigger the event associated with this area of text (if necessary).

    I hope this helps.

Maybe you are looking for