How to change the color of the border of TextBoxField OnFocus

Hi all

I use the following code to the TextBoxField:

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

now, I try to change the color of border TextBoxField when it focused. But could not able to get.

need help on this.

Thank you

amsiddh wrote:

Hi arkadyz,

I really appreciate how you explained and thanks for sharing the code snippet. I tried your code snippet of change of border.

I have a few problems at the border change on focus, but I could not able to see the cursor in the text box and cannot able to type something in the text box or can it be get typed but not painted on the screen. If I remove this methods I see the cursor and the type of keywords but not border change.

I added these two methods

protected void onFocus(int direction) {
   if(direction == 0 ||  direction == 1 || direction == -1) {
       myBorderColor = Color.BLUE;
    }
}

protected void onUnfocus() {
     myBorderColor = Color.BLACK;
}

I think it has to do with a painting of editField method. I have tried to understand but not succeeded. can u please help

Where did you add these methods?  The field only focusable you have is editField, if you need it.  Furthermore, I already mentioned that you need to invalidate() your TextBoxField together for it to be repainted.  Thus, the creation of editField should look like this:

    EditField editField = new EditField("", "", EditField.DEFAULT_MAXCHARS, FOCUSABLE) {
        protected void onFocus(int direction) {
            myBorderColor = Color.BLUE;
            TextBoxField.this.invalidate();
        }

        protected void onUnfocus() {
            myBorderColor = Color.BLACK;
            TextBoxField.this.invalidate();
        }
    };

Your myBorderColor must be a member of private int TextBoxField himself.

Edit: first, add super.onFocus (branch) and super.onUnfocus () as the first lines of the corresponding methods.  Secondly, I just found out that onUnfocus() is never called!  You're talking about BlackBerry framework!  I tested it under Simulator (9000 "BOLD"), but things GUI is usually the same on the actual device.

What is interesting, is that I have used these methods several times and they always work.  Strange...  When I have the time to study more, I'll know what goes wrong and post the results here.

Tags: BlackBerry Developers

Similar Questions

  • How to change the border style of the list items in the apex


    Hi all

    We have created a few items from the selection list in the Apex and ask users to make changes to the border.

    I tried many ways, but he was not able to make changes, some could help me how we can change the border style of list items in Apex. By, the approach has been used by us

    Attributes of the element in the HTML form -> style = "" border: 1px solid #E5E4E2; "" [I speak that way] but no luck.

    Kind regards

    Sheikh tayeb.

    SruthiTamiri wrote:

    Hello

    Please find the details below

    APEX version # 3.2

    Internet Explorer version #7

    Mozilla version 12.0.

    Used theme #Blue

    Topic identification number is #12

    It is not possible to change the appearance of the borders of the selection list in IE7.

    To the borders of all the elements of the selection list style on a page in other browsers, include the following style sheet in the HTML Header page:

    .formlayout select {
      border: 1px solid #E5E4E2;
    }
    

    APEX 3.2 is no longer supported, and IE7 is obsolete. Upgrade to the current version is recommended.

  • How to change the border against zero using javascript?

    Hello

    guys im quite new to adobe live cycle designer es2 I have a really easy.

    How can I change the hour or the appearance of a solid against zero TextBox after pressing a button

    I tried this on the FTT even click a button but seems to not work.

    NumericField1 [0] .border = 'None ';

    any suggestions? would be appreciated a youn noob.

    Hello

    The problem in your form was that it has been defined as static form.

    You must do the following to make the script work.

    (1) file menu Goto-> properties of the form and select the default values tab change the default rendering in dynamic XML form Format

    (2) select the Preview Tab. Set the type of overview as a form 'Interactive form' and preview Adobe XML dynamic XML form

    (3) Finally, while saving the PDF select Save As Type 'Adobe Dynamic XML Form.

    I corrected the form and is available at the link below.

    https://Acrobat.com/#d=R7qmed71zsu744V0Qvddvg

    Also try to give unique names to controls that are not related to each other.

    Thank you

    Srini

  • errorString - how to change the border thickness

    Hello! :)

    I want to do for the thicker inputText border when the errorString is set.
    Don't get what I need to do...
    This is my code:

    You can use setStyle in an event handler, preferably a ValidationResultEvent:
    textInput.setStyle ("borderStyle", "solid");
    CSS can not change this style.

  • change the border color of an image control

    Hi all

    I shows 30 photos on the façade by using an image control. I want the user to select 12 peaks of 30 photos.

    is there an interactive way to show what image has been selected. I thought that it would be OK to change the color of the border of the control.

    I would like to know how to change the border color of th and you are really welcome if you have a better way to say what peak has been selected.

    Thank you

    Ritesh

    Hi Ritesh,

    in my LV7.1 installation I could change bordercolor using the tool to color in development mode, but I couldn't find a property to change the colors by programming...

    So my advice would be to put a little bigger Boolean flags (or color boxes) behind the indicators of the photo. When the image is clicked/selected just change you the color of the underlying Boolean value. In this way imitate you the colorchanging of an indicator of the photo border...

  • How to change the color of the box

    Hello

    I want to change the color of the border of the checkbox (square shape). How can I do. I see control to change the color, but all are change fonts. I want to change the border/edge of the rectangular area that I check.

    Concerning

    Sunil

    It can be done as described here in the thread above.

    Here's a sample for you.

    https://workspaces.Acrobat.com/?d=YZazpiJgxQPoZEWtbvA-UQ

  • How to change the color of pre-rendered screen.

    My question is how to change the color of the page that is displayed before a site is fully charged. So let's say I go to a site where the background color is red. Before the end of Firefox loading it will appear as white. Also yes I have known that I have an add-on which changes the default color of YouTube. However the first picture comes on all websites no matter if their background is white or not.

    You can try the userChrome.css code or elegant.

    Add code to the file userChrome.css below default @namespace.

    @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    
    browser {background-color:#f0f0f0!important}
    

    The file userChrome.css (UI) customization and userContent.css (Web sites) are located in the folder of chrome in the Firefox profile folder.

    You can use this button to go to the current Firefox profile folder:

    • Create the folder chrome (lowercase) in the .default < xxxxxxxx > profile folder if the folder does not exist
    • Use a text editor like Notepad to create a userChrome.css (new) file in the folder chrome (file name is case sensitive)
    • Paste the code in the userChrome.css file in the Editor window
    • Make sure that the userChrome.css file starts with the default @namespace line
    • Make sure that you select "All files" and not "text files" when you save the file via "save file as" in the text editor as userChrome.css.
      Otherwise, Windows can add a hidden .txt file extension and you end up with one does not not userChrome.css.txt file
  • It is difficult to see how to change the color of the scrollbar in gray on gray background?

    It is difficult to see how to change the color of the scrollbar in gray on gray background?

    I think you should probably use an extension or theme to replace the default colors.

    If you are not interested in all the changes that might come with a new theme, is the next extension compatible with Linux?

    https://addons.Mozilla.org/firefox/addon/noiascrollbars/

  • How to change the background of the playlist window colors in iTunes

    The background color of my playlist 'window' in iTunes is black, which is difficult to read.  How to change the background of all the playlists to a light color.

    All the indications are that the selected background colors are random and cannot be changed. If someone knows a way to change them please let us know.

  • How to change the color of the mailbox that contains new messages

    I have Thunderbird sort my incoming mail into different mailboxes based on different criteria.

    Until recently, the arrival of new messages in any box, the title of this box (in the list, the left pane) became Red - which makes it easy for me to identify what boxes necessary to my attention. For some reason, it stopped. The incremental number indicating the number of unread to messages always changes, but the color of title remains black.

    Someone knows how to change the behavior in order to highlight the mailboxes containing new messages please?

    Thank you...

    by using a theme? or a userchrome file?

  • How I change the fonts and colors of default return?

    I changed the font and the color of the text through the Tools button and the button options and the tab content. I can't find anything tell me how to change the fonts and colors to the colors and fonts by default. Can you advise me? I use Windows 7 Home Premium OS. Thank you.

    Hi Brenda19605,

    You can use this article to set the fonts and colors: https://support.mozilla.org/en-US/kb/change-fonts-and-colors-websites-use?esab=a & s = do & r = 0 & s = as

    The default settings for the police are in this article:
    https://support.Mozilla.org/en-us/KB/some%20text%20shows%20up%20bold%20after%20upgrade

    Unfortunately for the default color has no good reference. For the text, but it is black (most lower-left), the background is white (color above left). Unvisited links is blue (column 8, line 5) and the visited link is purple (column 9, line 5).

    Let me know if you need help more!

    Lordfreak

  • How to change the font colors in the communities of support?

    How to change the font colors in the communities of support?

    Thank you

    Press or click on use the Advanced Editor in the upper right of this text block which will take you to it.

  • How to change the color of Satellite Pro P300 settings

    I just received my new laptop computer and cannot for the life of me find how to change the color settings in the monitor.
    My old desk there was a button on the monitor.

    In a first time laptop user im nuts will try to find how to change my monitor settings...

    If anyone can help id be so grateful

    Please don t mix the portable computers internal monitor with external PC monitor.
    You won't find any control unit and on the external monitor that would help you to change the color.

    I put t know what your laptop smart chart uses but my laptop supports Intel graphics card and pre-installed (in Control Panel) Intel Graphics Media Accelerator provides a few color correction settings.
    The parameters are; color, gamma, brightness and contrast

    Here, you can set values between 0 and 100

    Maybe it's what you're looking for

  • How to change the settings on the Equium A100 color & contrast

    Does anyone know how you change the settings on the Equium A100 color & contrast? Thank you.

    Hello

    Change the contrast and color?
    Well buddy, you can change the screen brightness level using the FN + F6 and F7 key combination of.
    The other settings are only editable in the properties of the graphics card.
    I put t know what graphics card you are using but usually you must search advanced options.
    Check if there is no gamma, brightness or contrast settings.

    I found these settings on my laptop. I have a graphics card intel and the option was called the color correction

  • How to change the color of the Apple Watch pointer?

    How to change the color of the Apple Watch pointer? In the style of color Apple Watch ca change you the color of the masince, complication, brands, etc. However, the needle of the hours and minutes remains white and red dark second pointer. Is there a way to set the pointers to become Gold?

    Hello

    It is not currently possible to customize the color of the hand or the second on the color dial hand.

    If a customization option is not specified for any feature of any particular face watch, then it cannot be customized.

    More information:

    https://help.Apple.com/watch/#/apd6ce85daf4

Maybe you are looking for