In the edit field

Hi all

can someone help me in editing this.in field, enter text when the field width fill then is not to go to the next line.its decerese fontsize and decrese... time to come when the font size of text would be constant.i do customize edit field and override the paint method in this... How to set the size of police... so that his decrese when full field width and text do not go in the following line

THX

thx a lot its work for me

Tags: BlackBerry Developers

Similar Questions

  • Menu appears on touchevent click EditField. CONSUME_CLICK is not an option to the edit field.

    The Menu appeared on a touchevent click an EditField.  CONSUME_CLICK is not an option to the edit field.

    He always did, but I still have to figure out what caused change to happen.  Maybe because I went to GridFields.  Anyone has any ideas on how to avoid that the menu when I use a touchscreen device and click the EditField?

    Thank you!

    When you override navigationUnclick, return false - return super.navigationUnclick (status, time). It is a cleaner way to do it and it saved my day several times.

  • Get the text in the Edit field

    Hello

    In my Application, I add a check box and a label field and a field change a grid field Manager. Then this network domain manager, I add several times in Vertical field Manager. So it's looking like list of items. Now, when I checked the box five, trying to get the text of the corresponding edit field.

    This is the code for the domain network manager:

    int c[] = {screenWidth/6, (screenWidth)/3, (screenWidth)/2};
            gm = new GridFieldManager(c, Manager.VERTICAL_SCROLL);
            Logger.out("Grocery", "Here it is coming"+i);
            cbfChecked = new CustomCheckBoxField();
            cbfChecked.setChangeListener(new FieldChangeListener()
            {
                public void fieldChanged(Field field, int context)
                {
                    if(checked[i] == false)
                    {
                        checked[i] = true;
                    }
                    else if(checked[i] ==  true)
                    {
                        checked[i] = false;
                        Logger.out("Grocery", "It is UnChecked" +checked[i]);
                    }
                }
            });
            gm.add(cbfChecked);
            Logger.out("Grocery", "Adding first Label Field");
            LabelFieldCustom lfFrom = new LabelFieldCustom((String) m_vtrItems.elementAt(i),Color.BROWN,FONT_FAMILY_0_SF_AS_16,Field.FIELD_LEFT);
            gm.add(lfFrom);
            Logger.out("Grocery", "Adding second Label Field");
            efcAmount = new EditFieldCustom(Bitmap.getBitmapResource("dob_text_box.png"), 25);
            efcAmount.setMargin(new XYEdges(30, 0, 0, 0));
            gm.add(efcAmount);
            return gm;
    

    Here I add the grid domain manager several times:

    for (int i = 0;i < m_vtrItems.size();i++)
            {
    
                vfm.add(getRow(i));
                vfm.add(new SeparatorField(SeparatorField.NON_FOCUSABLE));
    
            }
    

    Here is the snapshot of my screen:

    Please help me.

    You can access the field by index (prone to errors if).
    or you could save your fields in a data structure, such as a hash table, with the checkboxfield as key to the editfield as value.
    or...

  • Change the edit field

    Hello! All the

    How can limit us just a field change a width (say 70) and if user enters anything beyond the width while the text should scroll automatically save to make place for the user to enter text more...

    How to get there?

    If you enter "editfield scroll" in the search box, you get a lot of results.
    I guess that most link to this article:
    http://supportforums.BlackBerry.com/T5/Java-development/sample-code-scrollable-one-line-text-input-f...

  • Is not scrolling screen when the virtual keyboard is opened by clicking an edit field

    Hello

    I have searched and tried many things, but not got success.

    There are three managers of verticalfield in my screen.

    1.)

    vfmMain

    = new VerticalFieldManager(Manager.USE_ALL_WIDTH |) Manager.USE_ALL_HEIGHT | Manager.NO_VERTICAL_SCROLL) {}

    protected voidpaint (Graphics grphcs) {}

    if (imgBG! = null) {

    grphcs.drawBitmap (0, 0,

    imgBG.getWidth (), imgBG.getHeight (), imgBG, 0, 0);

    }

    Super.paint (grphcs);

    }

    protected void sublayout (int maxWidth, maxHeight int) {}

    maxWidth = UIConstants.

    SCREEN_WIDTH;

    maxHeight = UIConstants.

    SCREEN_HEIGHT;

    Super.sublayout (maxWidth, maxHeight);

    Super.setExtent (maxWidth, maxHeight);

    }

    };

    2.)

    vfmFieldNS

    = new VerticalFieldManager(Manager.USE_ALL_WIDTH |) Manager.USE_ALL_HEIGHT | NO_VERTICAL_SCROLL) {}

    protected voidpaint (Graphics grphcs) {}

    if (imgBGCoverInternetHome! = null) {

    grphcs.drawBitmap ((UIConstants.

    SCREEN_WIDTH - imgBGCoverInternetHome.getWidth () / 2, 0, imgBGCoverInternetHome.getWidth (), imgBGCoverInternetHome.getHeight (), imgBGCoverInternetHome, 0, 0);

    }

    Super.paint (grphcs);

    }

    protected void sublayout (int maxWidth, maxHeight int) {}

    maxWidth = UIConstants.

    SCREEN_WIDTH;

    maxHeight =

    imgBGCoverInternetHome.getHeight () / *-UIConstants.SCREEN_HEIGHT (UIConstants.LABEL_HEIGHT + UIConstants.FOOTER_MENU_HEIGHT) * /;

    Super.sublayout (maxWidth, maxHeight);

    Super.setExtent (maxWidth, maxHeight);

    }

    };

    3)

    vfmScroll

    = new VerticalFieldManager(USE_ALL_WIDTH |) USE_ALL_HEIGHT | VERTICAL_SCROLL) {}

    protected void sublayout (int maxWidth, maxHeight int) {}

    maxWidth = UIConstants.

    SCREEN_WIDTH;

    maxHeight =

    imgBGCoverInternetHome.getHeight () - imgButtonFocusBig.getHeight (/2/*UIConstants.SCREEN_HEIGHT - (UIConstants.LABEL_HEIGHT + (UIConstants.FOOTER_MENU_HEIGHT + VERTICAL_GAP))) * /;

    Super.sublayout (maxWidth, maxHeight);

    Super.setExtent (maxWidth, maxHeight);

    }

    };

    I'm addidng all fields in the Manager of scrolling that is vfmScroll.

    By clicking on the edit field, virtual keyboard opens on the screen, change the field leathers and screen does not scroll.

    Help, please.

    Thanks in advance.

    Thanks for the reply of Peter. Instead of UIConstants.SCREEN_HEIGHT, now I use Display.getHeight () - headerHeight-footerHeight. Given that Display.getHeight () is calculated accordingly when the virtual keyboard is open, so his works well for me.

  • Text of tip/guest/space reserved on a digital editing field / password

    Hi all

    I am introducing the rapids/tips for the edit fields text in my application. I capture the key in the api keyChar() and therefore

    • show the cue text if the field is empty
    • hide the cue already displayed text when the first character is entered

    According to me, one way to do this is to paint your index directly on the EditField.  This way, the EditField never sees.  And you can paint it in a light color to indicate clearly what is not actually entered.

    Here is an example of code, note that I cut/pasted it from a working application, but changed a few things that I think are not - but it could have messed up it completely...

    private BasicEditField _searchField = new BasicEditField ("", "") {}
    String emptyString = "search by input characters;
    Protected Sub paintBackground (Graphics g) {}
    g.setBackgroundColor (0x00FFFFFF);
    g.Clear ();
    }
    protected void paint (Graphics g) {}
    oldColor int = g.getColor ();
    try {}
    g.setColor (0x00000000);
    Test string = super.getText ();
    If (test == null | test.length ())< 1="" )="">
    g.setColor (0 x 00808080);
    g.drawText (emptyString, 0, 0);
    }
    Super.Paint (g);
    } {Finally
    g.setColor (oldColor);
    }
    }
    };

  • Two sliders in the custom field definition

    Hi guys,.

    First of all, I want to thank all those who helped me to this day. This forum has been essential for blackberry dev work I do, and I would be screwed without you guys. That being said, I'm having a problem. I install a custom like this text entry field.

    (1) creates a vertical field Manager, assigned a background and resized image with setExtent(). (works fine)

    (2) created a new type of field and inserted in the vertical field Manager to make native look (almost works)

    The problem I have is that two sliders are appearing. Cursor #2 is dynamically updated as it should be, but the #1 cursor seems to be a "flawed slider. Please see the image below for details.

    The custom field is defined using the following code. If I remove the custom field, or cursors comes, so I am positive that it is the source of the problem.

        public class JustifiedEditField extends HorizontalFieldManager implements FieldChangeListener {
            BasicEditField ef;
    
            public JustifiedEditField(long style) {
                super(USE_ALL_WIDTH);
                ef = new BasicEditField(style) {
    
                    protected void onDisplay() {
                        setPosition(10, 17);
                        update(0);
                        //invalidate();
                    }
    
                    protected void update(int d) {
                        super.update(d);
                        setPosition(10, 17);
                        //invalidate();
                    }
    
                    protected void paint(Graphics graphics) {
                        graphics.setColor(Color.WHITE);
                        getFocusRect(new XYRect());
                        drawFocus(graphics, true);
                        super.paint(graphics);
                    }
    
                    protected void onUnfocus() {
                        invalidate();
                    }
    
                    protected void onFocus(int direction) {
                        invalidate();
                    }
    
                    /**
                     * Intercepts ESCAPE key.
                     * @see net.rim.device.api.ui.component.TextField#keyChar(char,int,int)
                     */
                    protected boolean keyChar(char ch, int status, int time) {
                        switch(ch) {
                            case Characters.ESCAPE:
                                // Clear keyword.
                                if(super.getTextLength() > 0)
                                {
                                    setText("");
                                    return true;
                                }
                        }
                        return super.keyChar(ch, status, time);
                    }
                };
                add(ef);
            }
    
            protected void sublayout(int width, int height) {
                super.sublayout(width, height);
                setExtent(width, 57);
            }
    
            public BasicEditField getEditField() {
                return ef;
            }
    
            public String getText() {
                return ef.getText();
            }
    
            public void setText(String value) {
                ef.setText(value);
                invalidate();
            }
    
            public void setChangeListener(FieldChangeListener changer ){
                ef.setChangeListener(changer);
            }
    
            public void fieldChanged(Field field, int context) {
                invalidate();
            }
        }
    

    I am totally stuck on this issue, any help would be really appreciated. TIA!

    I came up with an alternative solution. It turns out that I can use a transparent border to set the offsets to where the edit field must be located within the input Manager; thus eliminating the need to use setPosition.

  • Editable fields dialog box

    Hi, I created a dialog box with a BasicEditField but when I run the app I can't enter alphanumeric data in the edit field.

    Anyone see where I was wrong?

    Constructor
    BasicEditField _orderno = new BasicEditField ("Order #:", "", 10, BasicEditField.FIELD_LEFT |) BasicEditField.EDITABLE);
    ObjectListField _orderList = new ObjectListField(ObjectListField.USE_ALL_HEIGHT |) ObjectListField.USE_ALL_WIDTH);

    public SetOrderNumberDialog()
    {
    Super (null "Define the order number", null, 0, My.mLogo, Field.FOCUSABLE |) Field.FIELD_HCENTER);
    Add (new SeparatorField());
    Add (_orderList);
    Add (new SeparatorField());
    _orderList.setSelectedIndex (0);
    Add (_orderno);
    getOrderList();
    }

    Sorry my fault. I guess I overide the keyChar() and that is why any touches of character have been accepted.

  • Interactive report with checkbox and editable field

    Hello

    For a project I'm working on, I need to create an interactive report in Apex 3.2 with the ability to select rows and change one of the columns in the report.
    To do this, I started by adding these two fields at the request of my IR selection:

    CB apex_item. CheckBox (1, product_number)

    and

    apex_item. Text (2, QTY_TO_ORDER) QTY_TO_ORDER

    CB is the files checkbox and QTY_TO_ORDER is the editable field.

    It worked like a charm and I had my two fields in the report.
    To process the values, I've added this page process, which currently must store only the "product number" and the "QTY_TO_ORDER" fields in a table.

    BEGIN
    BECAUSE me in 1.APEX_APPLICATION. G_F01. Count LOOP
    insert into mytmptable values (APEX_APPLICATION. G_F01 (i), APEX_APPLICATION. G_F02 (i));
    END LOOP;
    commit;
    end;

    However, this does not work as I want it to work. When I check the boxes of the two rows, it will store two numbers of good product lines, but it will take the field QTY_TO_ORDER two albums from the table, regardless of who those are checked. I was able to solve this problem, by adding a rownum in the query and using the rownum as the value for the checkbox control. Because I still need that the areas of product_number and qty_to order I made them two text fields.

    I changed my page process of:

    BEGIN
    BECAUSE me in 1.APEX_APPLICATION. G_F01. Count LOOP
    insert into mytmptable values (APEX_APPLICATION. G_F02 (APEX_APPLICATION. G_F01 (i)),
    APEX_APPLICATION. G_F03 (APEX_APPLICATION. G_F01 (i)));
    END LOOP;
    commit;
    end;

    This seemed to solve the problem, and I have now received the good values in the table, unless I used in the report to sort... As soon as I've sorted the report in a different way from that of rownum, I had bad values in the table. The reason is of course that my insert simply selects the nth line in the table, and my rownums are not dynamic.

    I found a lot of examples on the internet using "#ROWNUM #" in the selection, which is expected to spawn a rownum in the report. It seems to work in normal report, but in interactive reports, literal values "#ROWNUM #" appears.

    Is it possible to fix this?

    Hello

    Try with 3 fields:

    CB apex_item. CheckBox (1, product_number).
    apex_item. Text (2, QTY_TO_ORDER) QTY_TO_ORDER,.
    prod_no apex_item. Hidden (3, product_number)

    The hidden field should be view as a hidden column.

    Then your process can be:

    BEGIN
    BECAUSE me in 1.APEX_APPLICATION. G_F01. Count LOOP
    J in 1.APEX_APPLICATION. G_F03. Count LOOP
    IF APEX_APPLICATION. G_F01 (i) = APEX_APPLICATION. G_F03 (j)) THEN
    insert into mytmptable values (APEX_APPLICATION. G_F01 (i), APEX_APPLICATION. G_F02 (j));
    "exit";
    END IF;
    END LOOP;
    END LOOP;

  • Get the value of the title field

    My question is simple. Here's my scenario.

    I have a check for profile, with an editable title field and a list of options. The user selects a value in the option list and entered a title. When he submits the form, the title of the content check-in must be derived from the value of the option list + the value of the field title. The derivative title must be the concatenation of the value of the option list, and the value of the field title.

    My question is how to get the value of the field title using the script of the OIDC? I have a rule with the field of dDocTitle and its derivative field, I have an idoc script that displays the value of the option list in the spin-off title field. I only need to concatenate the value of the editable field title entered by the user.

    Thank you. I use UCM 10 g.

    This can be done with rules and profiles of the school boards and derived values.

    If the user enters a title in the field of dDocTitle (this is mandatory) and if you have another field of metadata with a menu drop-down (as conceptual dDocType) you can use the Configuration Manager (rules and profiles) take the value of dDocTitle and dDocType and when checked (it not shown to the user after logging) she'll concatenate.

    in the custom box (you may need to do this because of the wrong inserts quotes with our variables) make sure that it looks like this
    <$dprDerivedValue=dDocTitle &="" ddoctype$="">

    Notes that may be of interest
    How can define you a value derived in a rule using Idoc Script to call a service? (Doc ID 833953.1)
    Who wins: rule or a set of default metadata about a file? (Doc ID 798653.1)

  • Non editable field change to highlight the problem

    Hi all

    I have an edit non editable field in my screen. In order to make the difference between editable and non editable field, I put the bottom of the field cannot be changed to light gray as in the code below:

       Border nonEditableBorder=BorderFactory.createRoundedBorder(new XYEdges(5, 5, 5, 5),Color.LIGHTGRAY,Border.STYLE_FILLED|Border.STYLE_TRANSPARENT);
    EditField textField=new EditField(EditField.NO_NEWLINE|EditField.FOCUSABLE|DrawStyle.RIGHT);
    textField.setBorder(nonEditableBorder);
    

    Now the field cannot be changed when I scroll the wheel to the right or left the text gets highlighted in white as shown in the image below:

    I don't want the text to highlight. Can anyone help me please with this. Thanks in advance.

    Kind regards

    S.A.Norton Stanley

    Hello

    Thank you. Overridding method drawFocus() and nothing doing, emphasis has been disabled on the fields and the white highlight was not. But once I reached the first or the last field of the white selection screen gets drawn again.  But the border I also assign the background of the field edit as shown below, and this solved my problem.

    Background bgNonEditable = BackgroundFactory.createSolidBackground(Color.LIGHTGRAY);
    textField.setBackground(bgNonEditable);
    
  • How can I set the width of the part of the label of an edit field?

    Anyone know how I can configure the width of the part of the label of an edit field?  that is, I want to have my line to edit until a fixed width field labels.

    It is not possible to set the width of the part of the label of an editfield.

    In this case, you can use a LabelField with fixed width (the substitution of layout() method) and an EditField and add then both a HorizontalFieldManager.

    Concerning

    Bika

  • Deactivation of packaging of the values in the editable text field.

    Hi friends,

    I need to use the text with a fixed width field.

    And I want to disable the text wrapping in the editable text field.

    How can set a fixed width or / and turn back to the line.

    Thanks in advance,

    Stéphane

    See this Article.

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

  • Custom edit field - not drawing while typing of the text

    I created a custom edit field (code below), but there is no slider or text drawn while typing.

    The text appears if you click another field on the screen, but not while typing. I guess it has something to do with my method of painting, but I don't know?

    Tips for making more effective methos painting would be a bonus!

    Thank you!

    import net.rim.device.api.system.Display;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.FontFamily;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.component.EditField;
    
    public class CustomTextField2 extends EditField {
    
        private int fieldWidth;
        private int fieldHeight;
        private int button_colour = 0xF9F9F9;
        private int text_colour = 0x666666;
        private int border_color = 0xCCCCCC;
        private Graphics graphics = null;
        public CustomTextField2(long arg0) {
            super(arg0);
            fieldWidth = Display.getWidth()-100;
            //int off = 8;
            FontFamily fFam = null;
    
            try {
                fFam = FontFamily.forName("SomeFontHere");
            }
            catch (ClassNotFoundException e) {
                e.printStackTrace();
            }  
    
            Font font = fFam.getFont(Font.PLAIN, 20);
    
            Font defaultFont = font;
            int off = 8;
            fieldHeight = defaultFont.getHeight() + off + 10;
            this.setPadding(5, 20, 5, 20);  }
    
        protected void paint(Graphics graphics) {
    
            graphics.setColor(button_colour);
            graphics.fillRect(0, 0, fieldWidth, fieldHeight);
            graphics.setColor(border_color);
            graphics.drawRect(0, 0, fieldWidth, fieldHeight);
            graphics.setColor(text_colour);
            graphics.drawText(this.getText(),20,10/2);               super.paint(this.graphics);
        }
    
        protected void onFocus(int direction) {
    
            button_colour = 0xF9F9F9;
            text_colour = 0x666666;
            border_color = 0x3598CC;
            this.invalidate();
        }
    
        protected void onUnfocus() {
    
            button_colour = 0xF9F9F9;
            text_colour = 0x666666;
            border_color = 0xCCCCCC;
            this.invalidate();
        }
    
        protected void drawFocus(Graphics graphics, boolean on) {
    
              super.drawFocus(graphics, on);
        }
    
        protected void fieldChangeNotify(int context)
        {
            try {
    
            this.getChangeListener().fieldChanged(this, context);
    
            }
            catch (Exception e){
    
            }
        }
    
        public int getPreferredHeight() {
    
            return fieldHeight;
        }
    
        public int getPreferredWidth() {
    
            return fieldWidth;
        }
    
        protected void layout(int arg0, int arg1) {
    
            setExtent(getPreferredWidth(), getPreferredHeight());
        }
    }
    

    I just posted a code in another thread - he does most, if not all, of what you want. Take a look:

    Custom elegant EditField (textbox)

  • BlackBerry smartphones can not set the homepage on the Bold 9700, non editable field

    When I followed the instructions to reset the home page of the browser to the URL of my choice, I'm stuck.  It says choose Options, Configuration of the browser, and then type a new URL in the Home Page field.  Seems pretty easy.  But this field is not editable.  It is stuck on the first URL I've ever used on the device.

    Any ideas, anyone?

    Well, tweak, I tripped on the fix.  In the right corner is a field indicating the browser that you are cinfiguring.  If If you launched Setup breast to Internet, then it is already set to 'Internet browser' of course. However, change to something else temporarily (for example, MediaNet), then again the browser Internet... Presto!  The URL of the homepage field becomes editable - and also a 'current user' button appears to exist.  Hooray!

Maybe you are looking for