How to align the areas that fall within GridFieldManager

Hello

I have a GridFieldManager and I want to align the first three fields on the left and the last to the right. I tried to use ad FIELD_LEFT FIELD_RIGHT, but this does not seem to do the trick. Any ideas?

My code:

GridFieldManager grid = new GridFieldManager(3, 4, USE_ALL_WIDTH | NON_FOCUSABLE);
        for (int i = 0; i < data.length; i++) {
            LabelField label = new LabelField(data[i].getS1(), FIELD_LEFT | NON_FOCUSABLE);
            LabelField value = new LabelField(data[i].getS2(), FIELD_LEFT | NON_FOCUSABLE);
            LabelField unit = new LabelField(data[i].getS3(), FIELD_LEFT | NON_FOCUSABLE);
            BitmapField pic = new BitmapField(b, FIELD_RIGHT | NON_FOCUSABLE);
            grid.insert(label, i, 0);
            grid.insert(value, i, 1);
            grid.insert(unit, i, 2);
            grid.insert(pic, i, 3);
        }
        add(grid);

Hello

Try using Insert with a style:

grid.insert(label, i, 0, FIELD_LEFT);

Here is the link:

http://www.BlackBerry.com/developers/docs/5.0.0api/NET/rim/device/API/UI/container/GridFieldManager...

E.

Tags: BlackBerry Developers

Similar Questions

  • I can't write anything on the areas that fall within any web page

    When I opened a new web page, sometimes I have an annoying error when I try to write anything.
    The problem is solved by placing the mouse pointer over the area of the main search and to return to the same point.

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/Firefox/tools > Modules > appearance).

    • Do NOT click on the reset button on the startup window Mode without failure.
  • How can I make the image that is within the rectangle to move?

    Hi, I'm doing a Web page with muse and I found the Coffee pastries Katie page. There are some pictures in the home pages this movement inside the form when I scroll the page. Could someone please tell me that how can I make the image that is within the rectangle to move?  Thank you very much

    You can apply the scroll to fill the picture or the rectangle itself if you are referring to scrolling rectangle on the page.

    https://helpx.Adobe.com/Muse/using/scroll-effects.html

    https://helpx.Adobe.com/Muse/how-to/explore-new-scroll-effects.html

    https://helpx.Adobe.com/Muse/using/applying-scroll-effects-browser-fills.html

    Thank you

    Sanjit

  • How to align the edges of the images

    I have an image that resembles a parallelogram because when the inage has been taken there does not match the grid. How to align the edges?

    Appreciate the help.

    Different ways to do it... but without seeing an image of what you are doing then I would suggest that.

    First SNAP TO GRID.

    View > Snap To > grid

    Then

    Edit > Transform > distort

    This will allow you to move the corners and stretch the image.

    But if you share a screenshot or image we can help you in more detail.

  • How to align the position of a node in a pane of the grid using CSS?

    Hello

    I have an interface defined in FXML:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <?import java.lang.*?>
    <?import javafx.scene.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.layout.*?>
    
    <BorderPane xmlns:fx="http://javafx.com/fxml" >
        <center>
            <GridPane alignment="top_center" hgap="8" prefWidth="450" vgap="8" style="-fx-padding: 10;" >
                <styleClass>
                    <String fx:value="form"/>
                </styleClass> 
                        
                <children>
    
                    <Label text="From" GridPane.columnIndex="0" GridPane.rowIndex="0" />
                    <TextField fx:id="from" GridPane.columnIndex="1" GridPane.rowIndex="0"/>
    
                    <Label text="Recipient(s)" GridPane.columnIndex="0" GridPane.rowIndex="1" />
                    <TextField fx:id="recipients" GridPane.columnIndex="1" GridPane.rowIndex="1"/>
                    
                    <Label text="Subject (defaults to title)" GridPane.columnIndex="0" GridPane.rowIndex="2" />
                    <TextField fx:id="subject" GridPane.columnIndex="1" GridPane.rowIndex="2"/>                   
                    
                    <Label text="Send mail as ..." GridPane.columnIndex="0" GridPane.rowIndex="3" />
                    <ListView fx:id="mail_format" prefHeight="100" GridPane.columnIndex="1" GridPane.rowIndex="3" />  
                    
                    <Label text="Plain Text Mail" GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.halignment="center" GridPane.rowIndex="4" />                  
                    
                    <Label text="Template" GridPane.columnIndex="0" GridPane.rowIndex="5" />
                    <TextField fx:id="plain_template" GridPane.columnIndex="1" GridPane.rowIndex="5"/>                
                                      
                    <Label text="Send as is (do not dump into plain text)" GridPane.columnIndex="0" GridPane.rowIndex="6" />
                    <CheckBox fx:id="plain_noconvert" GridPane.columnIndex="1" GridPane.rowIndex="6"/>
                    
                    <Label text="HTML Mail" GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.halignment="center" GridPane.rowIndex="7" />
                                    
                    <Label text="Template" GridPane.columnIndex="0" GridPane.rowIndex="8" />
                    <TextField fx:id="html_template" GridPane.columnIndex="1" GridPane.rowIndex="8"/>               
    
                    <Label text="Other configuration" GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.halignment="center" GridPane.rowIndex="9" />
                    
                    <Label text="Reply-To" GridPane.columnIndex="0" GridPane.rowIndex="10" />
                    <TextField fx:id="reply_tos" GridPane.columnIndex="1" GridPane.rowIndex="10"/>
                    
                    <Label text="Cc" GridPane.columnIndex="0" GridPane.rowIndex="11" />
                    <TextField fx:id="ccs" GridPane.columnIndex="1" GridPane.rowIndex="11"/>
                    
                    <Label text="Bcc" GridPane.columnIndex="0" GridPane.rowIndex="12" />
                    <TextField fx:id="bccs" GridPane.columnIndex="1" GridPane.rowIndex="12"/>
                    
                    <Label text="HTML base (defaults to current server)" GridPane.columnIndex="0" GridPane.rowIndex="13" />
                    <TextField fx:id="html_base" GridPane.columnIndex="1" GridPane.rowIndex="13"/>
                                                                                                                   
                    
                </children>
            </GridPane>
        </center>
    </BorderPane>
    I want to align the labels to right using CSS:
    .form *.label {
      -fx-alignment: right;
      -fx-font-weight: bold;
      -fx-hpos: right;
      -fx-text-alignment: right;
      -fx-text-wrap: true;
    }
    However I have not found any way to align the labels in the GridPane using CSS, or - fx-alignment: right, - fx-node-hpos: right. -fx-hpos: right. -fx-text-alignment: seem to work well...


    The only way to make it work is to define the attribute of each label Grid.halignment:
                    <Label text="HTML Mail" GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.halignment="right" GridPane.rowIndex="7" />
    But what happens if I want to change that at a later stage-> I need to change this attribute for each node.


    How can align the labels to right using CSS only?

    Currently CSS in JFX cannot really be used for layout page (or calibration). This is one of those grey areas between what is style (which should be in the CSS) and what is layout (which should be in the FXML). I think I remember Richard mentioning once in a forum or an article that he did not want to add alignment stuff to the CSS at a certain point, but don't quote me on that. You might have a search through Kenai to see if there is a feature request for it and if not add one.

    Perhaps you could it with fake labels stretch to fill the available space in the GridPane. For this, you need to disable the restriction of maximum size (setMaxWidth and setMaxHeight to Integer.MAX_VALUE) and ensure your forced GridPane are such that the label will fill the cell. Once you have a stretched label alignment will come into play as the text is aligned relative to the area of the label (as opposed to a manager that aligns the entire label compared to its parent). I think that put a border on the label when debugging to work on what's going on.

    Another less confined but more flexible alternative might be to use variables in your FXML files. You can do this in a number of ways. We must create a bean that has all the variables of your on it with accessors get and then you can move it to your charger FXML namespace and then reference it by using things like ${myConstants.gridAlignment}. Another is to create static methods on a class that a node, these can then be called from the FXML using a notation similar to GridPane.alignment. This second approach only works for things where you want to work directly on the node, but for your scenario which should be ok I think. And then there is always the option to activate a script language in your FXML, allowing you to perform more nothing.

    Hope that helps,
    zonski

  • How to view the songs that were on the "rocket" using windows Explorer?

    How to view the songs that were on the "rocket" when buying using windows Explorer?

    Do you need the list or do you need knowledge where they are? If you are looking for the list just look for the Board of Directors. If you are looking for them on the "rocket" you must be connected in MTP Mode.

  • How to align the Hcenter fields in VFM?

    How to align the Hcenter fields in VFM? its giving problem

    solution on mine! years of posting for reference...

    what I did earlier.

    I wanted to have a manager of fixed size (maximum size) and put fields here, during an aliging then using stylebit it did not work. I used sublayout and fixed to what extent a perticular dimension

    resovled doing problem.

    It is not sufficient (or necessary) to if you want to use sublayout to have a fixed size, if you use the alignment, bcz setting hardcodedly properties, the other model overridden, so u must override the methods 'getPrefferedWidth & height', not the two held all the time, but according to the needs, if you want to:-alignment, you can try only method "width" and comparable to V-alignment. I included these methods and found that half of my UI related issues would have resolved more easily, if I tried this previously.

    Thank you best regards &.

  • How to make the plugin that works in the background?

    Hi, I need to make the plugin working in parallel in the background thread. It should start when Photoshop starts and stops when closing Photoshop. I think that the plugin type should I choose is "Automation" but these plugins are executed only when the user calls the plugin in the menu. How to make the plugin that runs when photoshop works without the need to invoke it manually? I don't want this plugin to be visible in any menu. This plugin is designed to work with the extension of the CEP.

    I ended up making invisible CEP extension that performs background tasks in the timer event handler:
    CEP 5 Extension HTML Cookbook for CC 2014 · Adobe-CEP/CEP-resources Wiki · GitHub

  • How to change the areas of region of report in read-only mode?

    How to change the areas of region of report in read-only mode?

    SKUD.

    Add fuction javascript after the page header (or section of function and Javascript variables)

    function disableItems(pRegionStaticId,pDisableFlag) {
      $('#'+pRegionStaticId).find('[name^=f]').each( function(){ /* matches fxx */
        if( $(this).attr('name').match(/f[0-9][0-9]/) ){
          return $(this);
        }
      }).attr('disabled',pDisableFlag);
    }
    

    pRegionStaticId is static Id + the region

    Note that this code specifically disables only the berries of request. Disabled items are not available after the submission (and are therefore different from readonly). But any javascript page can change disabled or readonly points (client side), so you need to check on the side server to validate the data.

    You can disable items to help

    disableItems ("MY_REGION_ID", true);

    and allow them, by passing false

    disableItems ("MY_REGION_ID", false);

  • How to set the time that my screen stays on?

    How to set the time that my screen lights up.  I have an iPod Touch 6?

    Settings > general > auto-lock

  • How to prolong the time that deleted files stay for me to see

    How to prolong the time that deleted files stay for me to see

    Original title: files deleted

    How to prolong the time that deleted files stay for me to see

    Hello

    You ask about the trash?

    Files remain in the Recycle Bin until you manually clear the location or you or someone else, manages the disk cleanup.

    If you do not ask the trash, please provide details.

    Don

  • How to change the programs that load when Windows starts

    In simple terms... How to change the programs that load when Windows starts?  Because my boot time is slow in arriving at my login screen!

    Download and run the "Autoruns" from Microsoft Sysinternals freeware:

    < http://technet.microsoft.com/en-us/sysinternals/bb963902="">

    It lists all programs that start at startup and allows you to disable it by simply removing a check mark.  This makes it easy to reverse in case something goes wrong.

    HTH,
    JW

  • How to extend the time that your computer stays on without activity

    How to extend the time that your computer stays on without activity?

    How to extend the time that your computer stays on without activity?

    Start button > in the search box, type power options > press the Enter key > left column > click on choose when turn off display > selections for battery and plugged inare. Click on the pointer, and you can choose how long. It may be 1 minute forever. Take that seek you. > click save changes when done. For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.

  • I did several back ups on my computer and I wonder how many of the discs that I have to hold. Can I get rid of all except the last backup?

    I did several back ups on my computer and I wonder how many of the discs that I have to hold. Can I get rid of all except the last backup?

    Thank you

    Scott

    Hi Scott,.

    You must keep all 10 backup.the disk new backups will contain only the last backups and will not have the previous backups.

  • How to align the c4100 series ink cartridge

    I have problems hologram out, so far I did 8 pages of alignment, and they look the same all OK for me, now I'm trying to align the cartridges.  My laptop uses windows 8.1.  How to align the cartridges.

    Thanks in advance.

    Hi @lyjonne

    You can install the full software features and use the Printer Wizard to align the cartridges, or you can use the printing and scanning doctor.

    Use this link to download and run the HP printer install wizard for Windows

    The HP printer for window installation wizard was created to help Windows 7, Windows 8, and users Windows 8.1 download and install the latest and most appropriate HP software solution for their HP printer.

    Or click here to download and run the printing and scanning doctor > www.hp.com/go/tools

    As you can see the Print and Scan Doctor allows you to print a page, to perform the alignment, to clean the print heads, get print diagnostic information and more.

    I hope this helps.

    -In support of Movember

Maybe you are looking for

  • Access code will not work to reset iPad

    An employee who retires gave his iPad.  She gave me an access code and password to his iTunes account.  I have reset the password, and you want to "Erase content and settings."   I get the message that the password is incorrect.  I tried the old pass

  • X 1 carbon display problems

    I used to use the carbon X 1 with duplicated to a Dell monitor display. It has stopped working. Only the display of the laptop is now available with the Dell monitor in port HDMI is not recognized. The display on the laptop doesn't have the correct r

  • signal analog aperiodic acquisition

    Dear Sirs, Excuse my English, this is not my mother tongue, but I can't get help on the forum in my language. I have LABVIEW courses are 2 but have not taught on DAQmx acquisition. I use LABVIEW2011, a card/CB68LP connector OR PCI-6229 and I want to

  • What is the command after the c prompt to erase my hard drive so I can reinstall

    I need to format my hard drive clean completely so I can reinstall another version of windows I do not remember the sequence according to the folder c: I need the sequence of commands Thank you

  • Login screen loads, then more nothing (will not continue to Windows)

    I have a HP Pavillion laptop and just today I tried to turn it on and it gets to the login screen, I type my password and then... nothing.  He goes to a space where I can see the mouse, but there is nothing to click on the screen.  CTRL-Alt-Del bring