Alignment of fields of VerticalFieldManager


Thanks, but I opted to use the HorizontalFieldManager... why even bother using VerticalFieldManager... He already has the word Vertical in the beginning lol.

Anyway, thanks again for the reply!

Tags: BlackBerry Developers

Similar Questions

  • How to align form fields in 4.2.6

    Hello

    I use apex 4.2.6.  Wanted to know how to align the fields according to my condition.  For example, 3 fields through and again a few 4 fields in the row.  I use 'Checkerboard'-> 'New Start line' attributes.  But this seems a little dirty.  Is there another way?

    I created an example on oracle for the EMP table.  If someone can clarify.

    (workspace: test_ws_anand user: anandgp password: cable123)

    img 2.png

    Thank you

    -Anand

    anand_gp wrote:

    I use apex 4.2.6.  Wanted to know how to align the fields according to my condition.  For example, 3 fields through and again a few 4 fields in the row.  I use 'Checkerboard'-> 'New Start line' attributes.  But this seems a little dirty.  Is there another way?

    I created an example on oracle for the EMP table.  If someone can clarify.

    (workspace: test_ws_anand user: anandgp password: cable123)

    Your layout grid settings were:

    Sequence Name of the element New line New field
    10 P4_EMPNO Yes Yes
    20 P4_ENAME NO. NO.
    30 P4_JOB NO. NO.
    40 P4_MGR NO. NO.
    50 P4_HIREDATE Yes Yes
    60 P4_SAL NO. NO.
    70 P4_COMM NO. NO.
    80 P4_DEPTNO NO. NO.

    This means that all elements on each line were placed in the same cell in the grid as the first:

    I created a copy of the application and changed the settings of the grid so that each element is in a cell of the grid:

    Sequence Name of the element New line New field
    10 P4_EMPNO Yes Yes
    20 P4_ENAME NO. Yes
    30 P4_JOB NO. Yes
    40 P4_MGR NO. Yes
    50 P4_HIREDATE Yes Yes
    60 P4_SAL NO. Yes
    70 P4_COMM NO. Yes
    80 P4_DEPTNO NO. Yes

    What gives the layout desired by 3 points in the first row and 4 in the second:

    You should consult the documentation on how question attributes affect layout. Note that the best way to control the layout is to change the properties of the layout of all the elements at the same time using the change all button on the page view component. The option Show Grid in the developer toolbar is also useful in showing the layout of the items in the grid.

  • Alignment of fields horizontally in the component af:query

    Hi friends,
    I'm developing a search box using the criteria named my VO dragging. This has created an af:query element in the search box. However, the fields are displayed in rows in the search box. I want to align those fields so that all fields are displayed in a single line. also how can I set the width of the field.

    Any ideas or advice how to do this.

    Thanks in advance

    Published by: user9197772 on May 20, 2013 03:58

    To do this, you set the maxcolmns and the rows of the af property: query as
    ... lines argument maxColumns = '1' = '10 '...

    MaxColumns argument must equal the number of fields you want to see in a single line.

    The length of the fields is controlled by the attribute displaywidth property in the VO. Here, you can display the width on the Interface user-instructions of the attribute tab.

    Timo

  • Alignment of fields

    I went around and around this issue and have not found anything definitive posted in this forum. I am trying to add a footer to my application. The footer consists of two LabelFields, aligned to the left of one and the other aligned right as so. However, no matter what I try, the best I can get is a layout as follows:

    The footer is the entire width of the screen which is OK. The foot is a HorizontalFieldManager

    and copyright and terms labels are themselves contained in their own VerticalFieldManager. The question that I have, as you can see above is that the terms field remains aligned in that's half of the screen. How can I get to be propped right?

    Peter, thanks for the reply. I ended up using this library (which I think I found in one of your previous answers to someone who had a similar problem):

    https://github.com/BlackBerry/samples-for-Java/tree/master/advanced%20UI/src/com/samples/Toolkit/UI/...

    Specifically, I used the JustifiedHorizontalFieldManager.java class.

  • Alignment of fields ARGH!

    Could someone please tell me the reference of the Grail on work how to align?

    I have... How do these things align right?

    HorizontalFieldManager fmLine2 = new HorizontalFieldManager( HorizontalFieldManager.NO_VERTICAL_SCROLL | HorizontalFieldManager.USE_ALL_WIDTH );
    
    displayLapTitle    = new LCDTitleField("Lap ", LabelField.FIELD_RIGHT);  displayLap         = new LCDField(""+0, LabelField.FIELD_RIGHT);    displayTimer2Title = new LCDTitleField("  ", LabelField.FIELD_RIGHT);   displayTimer2      = new LCDField(lcdFormat(0), LabelField.FIELD_RIGHT);
    
    fmLine2.add(displayLapTitle);
    fmLine2.add(displayLap);
    fmLine2.add(displayTimer2Title);
    fmLine2.add(displayTimer2);
    
    add(fmLine2);
    

    Here are a few rules:

    • HorizontalFieldManager respects the vertical alignment styles, but does not take into account the horizontal alignment styles and sets fields on the left to the right.
    • VerticalFieldManager respects horizontal alignmnet styles, but does not take into account the vertical alignment styles and sets up-down areas.

    So to align your four fields on the right, you can do something like this:

    VerticalFieldManager vfm = new VerticalFieldManager(USE_ALL_WIDTH);
    HorizontalFieldManager fmLine2 = new HorizontalFieldManager(FIELD_RIGHT);
    
    displayLapTitle    = new LCDTitleField("Lap ");
    displayLap         = new LCDField(""+0);
    displayTimer2Title = new LCDTitleField("  ");
    displayTimer2      = new LCDField(lcdFormat(0));
    
    fmLine2.add(displayLapTitle);
    fmLine2.add(displayLap);
    fmLine2.add(displayTimer2Title);
    fmLine2.add(displayTimer2);
    
    vfm.add(fmLine2);
    add(vfm);
    
  • Align the fields of HorizontalFieldManager

    vfm = new VerticalFieldManager(VerticalFieldManager.USE_ALL_WIDTH);
    hfm = new HorizontalFieldManager();
    Date now = new Date();
    SimpleDateFormat sdf = (SimpleDateFormat) DateFormat.getInstance(DateFormat.TIME_LONG);
    String time = sdf.format(now);
    hfm.add(new LabelField(time));
    labelField1 = new LabelField("1", LabelField.FIELD_HCENTER);
    labelField2 = new LabelField("2", LabelField.FIELD_RIGHT);
    vfm.add(labelField1);
    vfm.add(labelField2);vfm.setBackground(BackgroundFactory.createSolidBackground(Color.RED));
    hfm.add(vfm);
    add(hfm);
    hfm.setBackground(BackgroundFactory.createSolidBackground(Color.GREEN));
    

    Please take a look at this code. I expect to do the following: add time to the left of the horizontal field Manager, and then add a field in the center of it and in the right part. The first two tasks succeeded. But what is the problem with the third label, i.e. with "2"? Why would she be placed in the next line?

    Please tell me what I'm doing wrong...

    hfm = new HorizontalFieldManager(USE_ALL_WIDTH)
            {
                protected void sublayout(int maxWidth, int maxHeight)
                {
                    super.sublayout(maxWidth, maxHeight);
                    setPositionChild(this.getField(0),0,0);
                    setPositionChild(this.getField(1), (this.getWidth() - (labelField1.getWidth()))/2, 0);
                    setPositionChild(this.getField(2), (this.getWidth() - labelField2.getWidth()), 0);
                }
            };
            Date now = new Date();
            SimpleDateFormat sdf = (SimpleDateFormat) DateFormat.getInstance(DateFormat.TIME_LONG);
            String time = sdf.format(now);
            LabelField timeLabelField = new LabelField(time);
            hfm.add(timeLabelField);
            labelField1 = new LabelField("1", LabelField.FIELD_HCENTER);
            labelField2 = new LabelField("2", LabelField.FIELD_RIGHT);
            hfm.add(labelField1);
            hfm.add(labelField2);
            hfm.setBackground(BackgroundFactory.createSolidBackground(Color.RED));
            add(hfm);
            timeLabelField.setBackground(BackgroundFactory.createSolidBackground(Color.GREEN));
    

    Use this code, you will get the desired result.

  • Add or remove field on VerticalFieldManager

    Hello

    I have a problem about adding and removing fields on/to go vertical Manager after posting it. even if I used the invalidate() method to redraw the VerticalManager

    Here is my code, please I need a help

    public class TestingScreen extends MainScreen {
    
        public static VerticalFieldManager mainVerticalManager;
        public LabelField label1 ,label2;   
    
        public TestingScreen()
        {
            mainVerticalManager = new VerticalFieldManager();
            label1 = new LabelField("Label 1 text",LabelField.USE_ALL_WIDTH);
            label2 = new LabelField("Label 1 text",LabelField.USE_ALL_WIDTH);
            mainVerticalManager.add(label1);
            add(mainVerticalManager);
    
        }
    
        private MenuItem menuItem1 = new MenuItem("menuItem1", 0, 1)
        {
                public void run()
                {
                    mainVerticalManager.delete(label1);
                    mainVerticalManager.add(label2);
                    mainVerticalManager.invalidate();
                }
        };
    
        protected void makeMenu(Menu menu, int arg1) {
            super.makeMenu(menu, arg1);
            menu.add(menuItem1);
        }
    
    }
    

    Thank you

    You have debugged your code to prove that you're using this method?

    As a hypothesis, however, the field that you add and the domain that you delete are identical, so you won't see any difference.  How to change the text of the label2?

  • Field layout - splitting of alignment of fields

    Hello

    I would like to put four areas on a single line. The first field (a LabelField), I would like to align itself with the left side of the screen. The other three areas, I would like to align itself with the right side of the screen. What is the best way to achieve this?

    I put them all in a HorizontalFieldManager. I put the HorizontalFieldManger to Manager.USE_ALL_WIDTH. I put the LabelField for Field.FIELD_RIGHT and the other three fields to Field.FIELD_RIGHT. However, everything is left-aligned.

    Thank you

    I gave a few code snip: its created for button

    First go and take it and change it to your target.

    class MyHorizontalFieldManager extends HorizontalFieldManager
    {

    private ButtonField leftButton;
    private ButtonField rightButton;

    public MyHorizontalFieldManager() {}

    Super (USE_ALL_WIDTH);

    ButtonField leftButton = new ButtonField ("Left");
    setLeftButton (leftButton);
    Add (leftButton);

    ButtonField rightButton = new ButtonField ("Right");
    setRightButton (rightButton);
    Add (rightButton);
    }

    protected void sublayout (int maxWidth, maxHeight int)
    {

    Super.sublayout (maxWidth, maxHeight);

    width int = getWidth();

    ButtonField rightButton = getRightButton();
    If (rightButton! = null & is equal to (rightButton.getManager ())) {}

    int x = width - rightButton.getWidth ();
    int y = 0;
    setPositionChild (rightButton, x, y);
    }
    }

    getLeftButton() private ButtonField
    {

    return leftButton;
    }

    Private Sub setLeftButton (ButtonField leftButton)
    {

    this.leftButton = leftButton;
    }

    getRightButton() private ButtonField
    {

    rightButton return;
    }

    Private Sub setRightButton (ButtonField rightButton)
    {

    this.rightButton = rightButton;
    }
    }

  • Report - form how to align the fields above the other

    Hello

    I have the report formatting I want to have a field with guest left this one per line. I wish all the fields under one of the other goes down of left page.

    I tried all variants with layout-> alignment, but can not get the desired result. Description in the manual seems simple, but don't know what I'm doing wrong.

    I wish only one record per page. Super simple desired attached output.

    Thank you

    Yes, in the layout of the document. assistants can make the initial layout or you can do it manually, but even if you use the assistants you are always free to change the layout.

    When moving things from the presentation, you want to be careful about the flex and limit parameters. they are controlled by the buttons at the top where the ToolTips are "confine on ' or 'Confine offshore' and ' Flex on ' and «off Flex»

    If flex is on, many things may move when you move an object. Turn it off to see the difference (it is enabled by default).

    Borders is also important. You do not want to move items out of the box where it belongs unless you know what you're doing. By default, borders on.

    Good bye.

  • How to vertically align text field?

    I drop a couple of text field on the form, but there is no way to adjust the texts so that it starts from the top to the bottom instead of in the middle of the text box. Any help is very appreciated.

    Multiline value.

  • Properly aligning the field button in the status bar?

    Hello

    I've set up a status as shown in the picture below scroll bar.

    The icons that were placed between the left and right arrows are not uniform in all devices. I want their position to decide taking into account the width of the screen of the device.

    Can anyone suggest how it should be done? I used GridFieldManager to place this icons.

    Can anyone suggest me something?

    We hope to get an answer soon.

    Hello

    I managed to solve my problem by using TableLayoutManager.

  • Animated GIF field loses alignment

    Hello

    I have a background image set to a vertical Manager...

    n then I want to align a field led to a certain position on the screen... I tried to add the gif animated image to a manager of vertical and the substitution of the layout of this Manager position does not work too...

    Hey thanks... juice I get it working...

    Just replace the sublayout of the main Manager method and setPositionChild...

  • Align ButtonField Center in HorizontalFieldManger when ObjectChoceField is not selected

    Hello
    I have developed a screen in which there's a topic labelField below that there is an ObjectChoiceField... My position and ObjectChoiceField do not scroll and will remain constant, under the title and ChoiceField object I have some data that must be the subject of a scroll and I could achieve this scrolling thing but my problem is that I place a button below these materials and placed this button in HorizontalFieldManager as follows

    ButtonField back;
    HorizontalFieldManager But_Back = new HorizontalFieldManager (HorizontalFieldManager.FIELD_HCENTER);
    Back = new CustomButtonField ("Back", ButtonField.FIELD_HCENTER);
    Back.setChangeListener (this);
    But_Back.Add (back);

    The first problem: At when only the header of the loading of the page and object coice field and my left side coded hard LabelField will be present and the button below and when I select the value in the ObjectChoiceField then the values corresponding to the labelField letside will be displayed all I can attchieve using the fieldChanged but my button that is currently I am unable to put in the Center... that when the page is loaded without values are present, so the button is to the left side and when I select a value of ObjectChoiceField, then it is aligned to the Center, I want to be at the Center...
    FYI: in the order of scroll implememtn in my Constructori say

    Super (new VerticalFieldManager (), NO_VERTICAL_SCROLL);
    Here I put the code for coice position and object fields in two different HorizontalFieldManager and then announces to the screen
                 
    For the scrolling now, I create a verticalFieldManger like:
    VerticalFieldManager vor = new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL |) VerticalFieldManager.VERTICAL_SCROLLBAR);
    and each variable left and right in addition to HorozontalFieldmanger
    HFM HorizontalFieldManager = new HorizontalFieldManager();
    VFM. Add (HFM);

    and at the end I say
    HorizontalFieldManager But_Back = new HorizontalFieldManager (HorizontalFieldManager.FIELD_HCENTER);
    Back = new CustomButtonField ("Back", ButtonField.FIELD_HCENTER);
    Back.setChangeListener (this);
    But_Back.Add (back);
    VFM. Add (But_Back);
    Add (VFM);

    Add Field.USE_ALL_WIDTH in your VerticalFieldManager and DrawStyle.HCENTER in your ButtonField.

    Something like:

    VerticalFieldManager vfm = new VerticalFieldManager(Field.USE_ALL_WIDTH | VerticalFieldManager.VERTICAL_SCROLL | VerticalFieldManager.VERTICAL_SCROLLBAR);
    ///
    ///
    HorizontalFieldManager But_Back = new HorizontalFieldManager(HorizontalFieldManager.FIELD_HCENTER);
    ButtonField  Back = new ButtonField("Back",DrawStyle.HCENTER);
    Back.setChangeListener(this);
    But_Back.add(Back);
    vfm.add(But_Back);
    add(vfm);
    

    Concerning

    Bika

  • problem with the vertical field Manager / vertical scroll

    Hello

    I've set up a screen which makes use of a vertical field Manager by using the following code:

    class Main_Menu extends MainScreen {
    
        public class FixedWidthButtonField extends ButtonField{
            private int width;
    
            FixedWidthButtonField( String label, int Width){
                super( label, Manager.FIELD_HCENTER);
                width = Width;
            }
    
            public int getPreferredWidth(){
                return width;
            }
        }
    
        public Main_Menu() {
            setTitle(new LabelField ("Main Menu Screen", Field.FIELD_HCENTER));
            setStatus(new LabelField ("Breakout Game ©", Field.FIELD_HCENTER));
            VerticalFieldManager backgroundManager = new VerticalFieldManager(Manager.USE_ALL_WIDTH|Manager.USE_ALL_HEIGHT|Manager.NO_VERTICAL_SCROLL)
            {
                protected void paint(Graphics graphics) {
                    graphics.setBackgroundColor(0x0000A2E8);
                    graphics.clear();
                    super.paint(graphics);
                }
            };
    
            FixedWidthButtonField playButton;
            FixedWidthButtonField instructionsButton;
            FixedWidthButtonField topScoresButton;
            FixedWidthButtonField quitButton;
    
            playButton = new FixedWidthButtonField("Play",(Display.getWidth() / 2) - 80);
            instructionsButton = new FixedWidthButtonField("Instructions",(Display.getWidth() / 2) - 80);
            topScoresButton = new FixedWidthButtonField("Top Scores",(Display.getWidth() / 2) - 80);
            quitButton = new FixedWidthButtonField("Quit",(Display.getWidth() / 2) - 80) {
                protected boolean navigationClick(int status, int time)
                {
                    getScreen().close();
                    return true;
                }
            };      
    
            playButton.setMargin(40,0,0,0);
            backgroundManager.add(playButton);
            instructionsButton.setMargin(10,0,0,0);
            backgroundManager.add(instructionsButton);
            topScoresButton.setMargin(10,0,0,0);
            backgroundManager.add(topScoresButton);
            quitButton.setMargin(10,0,0,0);
            backgroundManager.add(quitButton);
    
            add(backgroundManager);
        }
    }
    

    The problem I have is that the screen scrolled down to see the empty space after the final touches, and I can't seem to overcome this problem and prevent additional scrolling. I just want the ability to scroll the 4 buttons and have a blue background on the entire screen.

    Thank you

    Just quickly, so watch migth have wrong, but if you have a good overview of this very useful article:

    http://supportforums.BlackBerry.com/T5/Java-development/MainScreen-explained/Ta-p/606644

    I think you will find that you need to add the following at the beginning of your screen manufacturer:

    Super (NO_VERTICAL_SCROLL)

  • Frustration of the alignment of text

    It seems impossible to align easily all the text in a LabelField.

    I add two fields to a simple HFM, and the left one is left aligned just like I want, but I want the 2nd right-aligned field.

    So I could better see what was going on, I put some color in an object, and it's the inner class of right field:

       private static class MovesField extends LabelField {
            MovesField( String n ) {
                super( n, LabelField.FIELD_RIGHT );
            }
    
            public int getPreferredWidth() {
                return 60;
            }
    
            public void paint( Graphics g ) {
                g.setColor( Color.DARKGOLDENROD );
                g.fillRect( 0, 0, this.getWidth( ), this.getHeight( ) );
                g.setColor( Color.BLACK );
                super.paint( g );
            }
        }
    

    RED is the first LabelField and goldenrod, the second I want to be propped right.  The text in the field is only 2-3 charaters long, so 60 pixels works very well, but the text is left aligned!

    It's really annoying.  The API says that it is a valid style, then why my text does not match?

    You can override sublayout in the HFM and right align the field manually. HFM width needs to be greater than the sum, and then the two fields to be worth it.

    protected void sublayout( int width, int height ) {
    
        super.sublayout( width, height );
    
        width = getWidth();
        height = getHeight();
    
        Field field = getSomeField();
        if (field != null && equals(field.getManager())) {
    
            int x = width - field.getWidth();
            int y = (int)(height * 0.50);
            setPositionChild( field, x, y );
        }
    }
    

Maybe you are looking for