Labels are centered, but the text fields are not

I can't seem to convince a RichTextField is centered on the screen.  This is a limitation of this particular area, or I am doing something stupid?  Copy the following code illustrates the problem:

package com.rim.samples.hello;

import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.component.RichTextField;
import net.rim.device.api.ui.container.HorizontalFieldManager;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;

final class HelloScreen extends MainScreen {
    public HelloScreen () {
        super();

        // The title is centered
        LabelField title = new LabelField("Test Field Attributes",
                LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH | LabelField.HCENTER
                | LabelField.VCENTER);
        setTitle (title);

        // A simple label added to the main screen is centered
        add (new LabelField("Yay! I'm centered!", LabelField.FIELD_HCENTER));

        // But a rich text field refuses to center
        add (new RichTextField("Boohoo, I'm not!", RichTextField.FIELD_HCENTER));

        add (new LabelField("Labels rock!", LabelField.FIELD_HCENTER));

        // The vertical field manager makes no difference
        VerticalFieldManager v = new VerticalFieldManager(VerticalFieldManager.FIELD_HCENTER);
        v.add (new RichTextField("field managers don't help :(", RichTextField.FIELD_HCENTER));
        v.add (new LabelField("VFM Labels work!", LabelField.FIELD_HCENTER));
        add(v);

    }
}

I tried FIELD_RIGHT but when HCENTER does not, nor does RIGHT.  I guess I can use a tag instead, but I was really hoping to use a centered text edit field.  Any ideas?  Thank you

Blister

The default behavior of RichTextField should use the full width. Try adding the RichTextField.USE_TEXT_WIDTH style

Tags: BlackBerry Developers

Similar Questions

  • content of the text field is not visible after change

    Hello

    I'm actually developing a litte in flash game and try to update the score in a textfield. The text field is dynamic and initialized with a value of 0 in the IDE.

    I use the following code to update the content of the text field in actionsript:

    txtBlocksPlaced.text = blocksPlaced.toString ();

    But: When I start the game, the initial value is - OK. When I am trying update the value with the code above the content is endangered - incorrect. The value of the text box and the variable displays the correct value that should be displayed. Fonts are included.

    I already checked: http://forums.Adobe.com/message/4919054#4919054 and these updates are installed on my machine.

    Please, someone has an idea? I do not get around what could cause this or what Miss me.

    Concerning

    Is the police that you used a common police or is it a special police?  Some policies will not incorporate independently going through the motions.

  • Get the value of the drop-down list (selectedIndex) and the text field - does not

    Hi all

    I'm trying to find and change the values selected by the user using a drop-down list and text field. Here's the code.

    ChangeRevDetails();
    function ChangeRevDetails(){
    
    
              var myDialog = app.dialogs.add({name:"Enter copyright information"});
    
    
    //    var monthlist = col1.dropdowns.add('myList', undefined, myList);
    
    
              var col1 = myDialog.dialogColumns.add();
              var col2 = myDialog.dialogColumns.add();
      
        col1.staticTexts.add({staticLabel:"Month:"});
              col1.staticTexts.add({staticLabel:"Year:"});
        col1.staticTexts.add({staticLabel:"Rev. no.:"});
        
        var myList = [ "January", "February",  "March", "April", "March", "April", "May", "June", "July", "August", "Sepetember", "October", "November", "December" ];
    
    
         var myMonth = col2.dropdowns.add({stringList:myList, selectedIndex:0, minWidth:100});//{minWidth:100});
         var myYear = col2.textEditboxes.add({editContents:"2013", minWidth:100});   
         var MyRev = col2.textEditboxes.add({minWidth:100});
    
    
        var RevMonth = (myList [myMonth.selectedIndex]);
        var RevYear = myYear.editContents;
        var RevNumber = MyRev.editContents;
        var RevToReplace1 = RevMonth +", "+ RevYear;
        var RevToReplace2 = RevMonth +", "+ RevYear + " Rev. " + RevNumber;
    
    
        var myResult = myDialog.show();
    
    
            if(myYear.editContents == "") //entry is "" 
            { 
            alert("Please enter some text into the contents field."); 
            ChangeRevDetails(); 
            }
            else if(myResult == true) //user entered datas 
            { 
    
    
                alert (RevMonth);
                alert (RevYear);
                alert (RevNumber);
                alert (RevToReplace1);
                alert (RevToReplace2);
    
    
                app.findGrepPreferences = NothingEnum.nothing;
                app.changeGrepPreferences = NothingEnum.nothing;
    
    
                // grep find/change
                app.findGrepPreferences = app.changeGrepPreferences = null;       
                app.findGrepPreferences.findWhat = "[\\l\\u]+?\\s?\\d{4},?\\s+[\\l\\u]+\\.*\\s+\\d+";
                app.findGrepPreferences.appliedParagraphStyle = app.activeDocument.paragraphStyleGroups.item("Back page"). paragraphStyles.item("Legal_7/9");
                app.changeGrepPreferences.changeTo = RevToReplace1;
                app.changeGrepPreferences.appliedParagraphStyle = app.activeDocument.paragraphStyleGroups.item("Back page"). paragraphStyles.item("Legal_7/9");
                app.activeDocument.changeGrep();
    
    
                app.findGrepPreferences = NothingEnum.nothing;
                app.changeGrepPreferences = NothingEnum.nothing;
      
        } 
        else //implies user clicked cancel 
        { 
        myDialog.destroy(); 
        }
    
    
    }
    
    

    The problem is, it does not take the value that the user selects in the drop-down list and the text field. It takes the default value as "January" and the year is '2013' as these two values are given as selectedIndex:0 and editContents: "2013". I compared the coding with a few other scripts work as well, but it does not work. I added several alert boxes to check the value we get.

    In addition, search for it and change also does not work. Please help me on this. Thank you.

    Kind regards

    Bachi. D

    Change the order of dialogresults:

    ...

    var myYear = col2.textEditboxes.add ({editContents: "2013", minWidth:100});})
    var MyRev = col2.textEditboxes.add({minWidth:100});)
    Ditto var = myDialog.show ();
        If (myYear.editContents == "") //entry is «»
        {
        Alert ("Please enter a text in the content field.");
        ChangeRevDetails();
        }
        else //user entered if(myResult == true) datas
        {
    var RevMonth = (myList [myMonth.selectedIndex]);
    var RevYear = myYear.editContents;
    var RevNumber = MyRev.editContents;
    "var RevToReplace1 = RevMonth + ', '+ RevYear;

    "var RevToReplace2 = RevMonth + ', '+ RevYear + 'Rev' + RevNumber;

    ...

    did not have a look for the problem of change to find

  • Label existing license, but the product key is not visible.

    I have a Dell Latitude Laptop which uses Windows Xp professional. It is a second hand laptop which I use for 2 years.

    He has proof of license label, but the product key is not visible. During the last week, I had a problem in which the laptop OS should be reinstalled. But a part of the product key was not visible. How to install the licensec version?

    Help, please.

    Hi Anil,

    Welcome to Microsoft Community where you can find the answers related to Windows.

    According to the description, it seems you are trying to find the product key for Windows XP.

    I suggest you to see the steps in the following Microsoft article.

    How to activate Windows XP: http://support.microsoft.com/kb/307890

    How to find a phone number for a Microsoft Product Activation Center: http://support.microsoft.com/kb/950929/

    If you need Windows guru, do not hesitate to post your questions and we will be happy to help you.

  • I changed the Arial font on the content tab, but the text is still not Arial. How to make this change?

    I want to change the font Arial text. I made the choice and there, but the text has not changed.

    In the content panel, next to the where you chose the police Ariel, click the Advanced button. Then in the dialog box that appears, uncheck "Allow pages to choose their own fonts.

  • Dynamic text centered in the text field

    Hello

    I have a text field with centered text, but when I want to replace this text with another, it is automatically left-aligned

    my code:

    sym.getComposition () .getStage ().getSymbol("Navigation").$("Txt1").html ("EVENT");

    is it possible to add alignment information?

    Thank you

    Hello

    Yes. Here's a case:

    sym.getComposition () .getStage ().getSymbol("Navigation").$("Txt1_»).css ("text-align","center") .html ("EVENT");

  • PDF document with the text field does not have to scroll down after being placed in InDesign

    Hello. I have a PDF form that has a text box. If people type a lot of text in there, a scroll bar appears so that someone who reads the form allows to scroll up/down in this text box to read all the data.

    I placed this PDF file in a new InDesign file. When I export a new PDF file, the text is still there, though, he is no longer scrollable. If I highlight the text in the box and drag my slider lower, I can highlight "invisible" text that matches the text that someone would normally scroll down to see.

    Is there anyway I can 'keep' scrolling form PDF > Indesign > new PDF?

    Original PDF form was made in InDesign. Thank you!

    The PDF file that has been placed in ID loses all interactivity and form fields. There is no way to do what you want.

    Bob

  • Print everything that is typed in the text field without printing the text fields

    Hello

    I am trying to print a form once filled the text fields I want to print just what I typed in the field, not the text field and the color in the text field. I use CS3.

    Any help would be appreciated!

    Hello Teddy and wellcome to the Group!

    If you want to change the fonts or other things, then you will need to use the PrePrint method. What I usually do is select PrePrint in the 'Show' section in the Script Editor (if you did not go to the toolbar at the top, Windows and select Script Editor). After selecting PrePrint you can now either type the name of the subform and the field you want to change (or you can place the cursor in the script dialog box, hold down the CTRL key and select the field with the mouse) and enter in the JS to change font. It's something like TextField1.fillcolor = "255, 255, 255; (which changes the background in white fill). You can also replace fillcolor fonts or border to change the color of the police or the border. I put a link to an Adobe website that goes over the color JS below changes. You just need to add a method of pre-press for each field that you want to remove the necessary on highlighting. Then once the user hits a button print that you have on the form or use CTRL + P to print the form, it will remove any highlighting.

    Now on the text field does not itself feel that I do not know what you ask for. You ask for the legend does not print or not there is a box around the data entered. If you don't want to have a box surround the text field located in the section purpose of the field (see image below). You just need to select none, if you want to just text. If you want to change that with JS, I put another link below that has the code to change the color of the border in white and the user can't see it. If you do not want to print the legend, the only method is to remove the legend from the text box and replace it with a static text that can be hidden, but I guess that it isn't what you're talking about (correct me if I'm wrong however).

    http://partners.Adobe.com/public/developer/en/LiveCycle/Designer/PDFs/ChangingFieldAndSubf ormBGColors.pdf

    https://forums.Adobe.com/thread/1409617

  • Narrowing of the text fields

    Hello everyone.  So I figured out how to develop simultaneous text fields, now I would at the same time reduce them.  Here's the scenario: a customer receives the form, between the 5 lines (or other) in a text field and the text game, expand fields.  Realizing that they entered too, they delete a line or two.  Unfortunately, the text fields do not contract.  Worse: someone enters a lot of information, removes a bunch of it and is stuck with a huge set of text fields when they just need a little space.  I would like it if all of the text fields would be collectively assume the size of the largest entry and not the following dimensions.  I enclose an example, and if someone want it to happen to unqueued, I'll be happy to email it to them.

    Bonus question: I have all my scripts in JavaScript.  Unfortunately, I can't figure out how to get the reference to subsequent subform instances to work in JavaScript.  If you look in the "Delete" button, you will see that it is film script in FormCalc.  The only reason I do it is to get this

    If (_Description_Value_Comments_and_Office_Comments.count == (this.parent.index + 1)) & (_Description_Value_Comments_and_Office_Comments.count <>, 1) & (choice == 4)) then

    Description_Value_Comments_and_Office_Comments [this.parent.index - 1]. Any_other_property_of_ this_type.rawValue = "2"

    endif

    to work properly.  When I try to do something similar in JavaScript, it doesn't seem to be able to handle this:

    Description_Value_Comments_and_Office_Comments [this.parent.index - 1]. Any_other_property_of_ this_type.rawValue = "2"

    I think it has something to do with the ILO [this.parent.index - 1], but I don't know how to fix it.

    Thank you all for your help.

    Post edited by: AJP256 Reason: changed "text boxes" to "text fields" because that's what I really wanted to

    Hello

    With respect to the height of the textfields, it would be easier if all the textfields were in a row. This way you can do away with the entire script, which tries to maintain height.

    It also makes it easier to add additional lines.

    I am downloading a sample (note should store).

    Good luck

    Niall

    PS, the file size seems v. large given the fact that there is no graphics?

  • How to select all the text fields at a given time in Adobe Reader ms?

    I created a document that contains more than one text field I created with Acrobat Pro DC, I want to allow the user the ability to select all fields in order to change the text size/color and fonts at the same time... not having to go through the entire form and must make each field separately. To be a little more specific, the document is two pages with six place/lounge cards per page, designed for weddings and other events. Each place card has a field for 'user name' and ' number of table: my question is...» Is it possible to 'select all fields' in Adobe Reader? If I go to Edition > select all, the program selects all graphics and none of the text fields. Not exactly what I'm missing here and I can not find my answer online. Any information would be greatly appreciated.

    Thank you!

    Jodi

    In this case, you can only change the properties of the text selected within a field. Acrobat Reader cannot change the properties of the text field.

  • I have a form in which the text area can be developed to accept more text, but the text does not appear on the printed copy.  How can I get the text to print?

    I have a form in which the text area can be developed to accept more text, but the text does not appear on the printed copy.  How can I get the text to print?

    Hi robinm6200,

    Make sure that you have selected 'Document and annotations' under 'Comments and forms' when printing.

    Kind regards

    Nicos

  • The present no embedded fonts in scanned documents containing plain text are not get converted fonts incorporated after OCR applied. But the texts are searchable. The text even unincorporated font that is formatted as text (not scanned) become stupid

    The present no embedded fonts in scanned documents containing plain text are not get converted fonts incorporated after OCR applied. But the texts are searchable. Even fonts not embedded text that is formatted as text (not digital) are themselves converted to fonts embedded by adobe distiller.

    Fix. Expected behavior.

    Output of the OCR is not incorporated. With Acrobat Pro, a preflight check is available to embed the fonts.

    On the use of Distiller - using a work option distill configured appropriately that the PDF created from the authoring application (FrameMaker, InDesign, MS Word, etc.) will have embedded fonts.

    Be well...

  • Implementation of an area of text similar to the text field (Disabled)

    Version: Apex 3.2

    I need a text element for display only similar to the text box element. How can I do? The height of the text element is not at the desired height.

    Thanks in advance for any assistance.

    cmovva

    cmovva wrote:
    Thanks for your help.

    Now the text element has a height. The width of the text element is e.g. 128 and the maximum width is 2028. The skin isn't in the text element.

    You can use a textarea for this.

    Otherwise, is anyway I can use the text box but turn it off so that the content can not be changed?

    I'm looking for two areas text view to edit existing comments and to view previous comments and the corresponding column is VARCHAR2 (2028).

    Use the read-only attribute. Set the property attributes of HTML form elements for the previous text box

    readonly="readonly"
    
  • How do i: fill automatically the area other sections of the text field form?

    Hello. Need help please!

    I need a script, I guess that for a field text entered by the user automatically fill the area in the headers in the form of entry.  The header is identified by all that will enter the name of the user on the cover page.

    ID be very grateful.

    Stephanie.

    If you name the field in the header exactly as the text field, then you just need to set the binding at the global level and no script is needed. You can set the binding in the object palette in the binding tab. Then in the drop-down default choose global binding.

    Paul

  • Labels are not displayed in the Multi series

    Hello

    According to my condition I'm going to a line chart that has multi series (row and column). I want to display labels on the top of the column series

    I tried all the options like

    (1) using a LabelFunction - no error labels not displayed

    (2) Labelposition = field of the 'legend' & label = 'id' - no error labels are not displayed

    Can any body tell me how this is possible. Let me know if you need more details about this

    Concerning

    Kalavati Singh

    [email protected]

    LineChart display labels.

    Use ColumnChart.

Maybe you are looking for

  • Compaq cq58: bios administrator password

    Nice dayI have a compaq cq58.I need the bios administrator password.The error code is 70769099.Please help.Thank you

  • Acer aspire 5742 laptop computer g does not start or it does not charge

    When I plug the laptop to the charger the light to signal that the laptop is does not load computer up.the light laptop too turns not on. I tried to remove the battery and wait five minutes before turning back, but it still does not work I don't know

  • I have to buy a new printer afer guarantee work? I'm having a problem with it.

    Support HP told me that I have to buy an another all-in-one HP Officejet because security missed.  But it still works.  I'm having a problem getting the printer and fax to work.  I have to buy a plug 3 pins to fix this?  I hope I can find some help h

  • The integration with third-party tools

    Hi all I have a question. I am to enter my vFoglight alerts in a third-party tool. My foglight server is a windows box, so I am using windows scripting and I installed the last integration Foglight cartridge. I'm trying to get Foglight to send alerts

  • WIndows 7 Home Premium BSOD when you play the game

    Dump file I got this while playing for ArmA 2 BCCode: 50BCP1: FFFFF6840003D858BCP2: 0000000000000000BCP3: FFFFF80002CB431BBCP4: 0000000000000005OS version: 6_1_7601Service Pack: 1_0Product: 768_1 On Edit, just OneDrive. File is attached.