Manager of madness!

I want a pair of elements on a single horizontal line. I want the label on the left side of the screen and the button on the right side with the white space between them. However, the code below is not working and is to ignore the styles of left and right.

        HorizontalFieldManager pOptionPairManager = new HorizontalFieldManager();        pOptionPairManager.add(new LabelField("test label", Field.FIELD_LEFT));        pOptionPairManager.add(new ButtonField("text button", Field.FIELD_RIGHT));        add(pOptionPairManager)

Instead, the label appears on the left side (as it should) and the button down on the right side of the label with the space between the button and the side of the screen.

How can I fix it?

HorizontalFieldManager does not take into account all the horizontal alignment styles, so FIELD_RIGHT, FIELD_LEFT and FIELD_HCENTER have zero effect on fields added to it.

You will need to use a custom manager - layout something like this:

public class MyOptionPairManager extends Manager {
  protected void sublayout(int maxWidth, int maxHeight) {
    Field field1 = getField(0);
    Field field2 = getField(1);
    int height;
    int availableWidth;

    layoutChild(field1, maxWidth, maxHeight);
    availableWidth = maxWidth - field1.getWidth();
    layoutChild(field2, availableWidth, maxHeight);
    height = Math.max(field1.getHeight(), field2.getHeight());
    setPositionChild(field1, 0, 0);
    setPositionChild(field2, maxWidth - field2.getWidth(), 0);
    setExtent(maxWidth, height);
  }
}

If you wish, you can calculate the coordinate y in setPositionChild() to vertically Center the fields (something along the lines of)

int y = 0;
if (field1.isStyle(FIELD_VCENTER)) {
  y = (height - field1.getHeight()) / 2;
}
setPositionChild(field1, 0, y);
...

and similarly for Field2).

After you create this class, add your label and button to this custom handler and get the results you want.

Of course, it can handle only two fields it contains. If you want to also spaced several fields, take a look at EvenlySpacedHorizontalFieldManager in

Implement advanced buttons, fields and managers

This article is an incredible resource of all things in the user interface custom - don't just download and use it, take a look at the code and learn!

Tags: BlackBerry Developers

Similar Questions

  • Could not the two centre manager custom made size

    Hello

    I try to add two VerticalFieldManager with the background Bitmap to an existing VerticalFieldManager, who is then added on a screen.  The problem that I am running is that when the two VerticalFieldManager is added at the same time, I can not both of them at the Center.  They are both almost centered, but a fair bit aligned.  If, however, I would add only one of the two VerticalFieldManager, and then it focuses without problem.

    I suspect that my problem might be because I'm from the substitution of sublayout() at the time of the VerticalFieldManagers, so that they are both the same size as the background Bitmaps.  Here's how I instantiated the VerticalFieldManagers:

    final Bitmap container2 = Bitmap.getBitmapResource(Constants.DEFAULT_IMAGE_ROOT + "backgrounds/locations_details_bottombox.png");
    
    VerticalFieldManager vfmContainer2 = new VerticalFieldManager(Manager.FIELD_HCENTER) {
        public void sublayout(int width, int height) {
            super.sublayout(container2.getWidth(), container2.getHeight());
            setExtent(container2.getWidth(), container2.getHeight());
        }
    };
            vfmContainer2.setBackground(BackgroundFactory.createBitmapBackground(container1, 0, 0, Background.REPEAT_NONE));
    vfmContainer2.setMargin(0, 0, 5, 0);
    vfmContainer2.setPadding(15, 0, 15, 15);
    

    Is there a problem with this operation I can not know?  I'd appreciate any help.

    Thank you!

    Remove your sublayout setExtent and add USE_ALL_WIDTH and USE_ALL_HEIGHT the style bits of your vfmContainer2 (in addition to FIELD_HCENTER) and see if that changes things.

    Besides, it's a good practice.to use super.sublayout like this:

    Super.sublayout ((width, yourWidth), Math.min Math.min (height, yourHeight));

    Be a little paranoid allows you to save a lot of headaches later.

  • The flow of work, Servlet, popup and a managed Bean validation

    Hello

    We try to display a PDF file in a pop-up window by calling a Servlet in a JSF page using a workflow in JDeveloper 11 g R2.

    The relevant part of JSF:
    <af:inlineFrame id="if1" shortDesc="Report" source="/pdfservlet" styleClass="AFStretchWidth"></af:inlineFrame>
    The /pdfservlet points to a Servlet with a method doGet as follows:
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      response.reset();
      
      OutputStream out = response.getOutputStream();
    
      FacesContext context = this.getFacesContext(request, response);
      OracleReportBean bean =
        context.getApplication().evaluateExpressionGet(context, "#{reportBean}", OracleReportBean.class);
    
      bean.run(context, out);
      removeFacesContext();
    
      out.close();
    }
    The Servlet is trying to get the FacesContext, but we met with the following exception:
    Caused By: javax.faces.FacesException: Cant instantiate class: oracle.adfinternal.view.faces.component.AdfViewRoot.
    We have removed the following lines to the getFacesContext() method:
    UIViewRoot view = facesContext.getApplication().getViewHandler().createView(facesContext, "");
    facesContext.setViewRoot(view);
    This avoids the exception above, however... We try to get the settings of the form that was submitted. Here is an example of the form element:
    <h:inputHidden value="MyMedicationList_Report" id="system_REPORT_RESOURCE"/>
    When the Servlet calls the Bean managed to retrieve the value, it uses:
    Map<String, String[]> requestParameters = getRequestParameters();
    Parameters p = getParameters();
    
    for( String key : requestParameters.keySet() ) {
      for( String value : requestParameters.get( key ) ) {
        int i = key.indexOf( ':' );
    
        if( i >= 0 ) {
          key = key.substring( i + 1 );
        }
    
        p.put( key, value );
      }
    }
    Where getRequestParameters() tries to get the external context to retrieve the map of query parameter values:
    return getExternalContext().getRequestParameterValuesMap();
    The card is empty.

    I tried after http://www.oracle.com/technetwork/developer-tools/adf/learnmore/oct2010-otn-harvest-183714.pdf by assigning the web.xml file:
      <!-- JspFilter must be configured before adfBindings. -->
      <filter-mapping>
        <filter-name>JpsFilter</filter-name>
        <servlet-name>PDFServlet</servlet-name>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>REQUEST</dispatcher>
      </filter-mapping>
      <filter-mapping>
        <filter-name>adfBindings</filter-name>
        <servlet-name>PDFServlet</servlet-name>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>REQUEST</dispatcher>
      </filter-mapping>
    And set the data bindings on:
      <pageMap>
        <page path="/pdfservlet" usageId="ca_bcpra_promis_reporting_view_PDFServletPageDef"/>
      </pageMap>
      <pageDefinitionUsages>
        <page id="ca_bcpra_promis_reporting_view_PDFServletPageDef" path="ca.bcpra.promis.reporting.view.PDFServletPageDef"/>
      </pageDefinitionUsages>
    The Servlet is running, called the managed bean instantiated, but cannot read the query parameters.

    Is the button used to start the workflow in a dialog box:
    <af:commandButton text="Run Report" id="submitReport" useWindow="true"
                      windowEmbedStyle="inlineDocument" windowModalityType="applicationModal" windowHeight="500"
                      windowWidth="700" action="runReport"/>
    By using a workflow, the user input are validated before the opening of the pop-up window. We want to keep this behavior. The PDF file opens and then returned with a NullPointerException:

    http://pastebin.com/raw.php?i=PaM64jL4

    The Servlet, through the managed bean, made a request to the report server to pass parameters and generate a PDF file. The PDF is sent to the browser via the Servlet.

    What other steps can we take to:

    1. send user and system parameters.
    2. generate a PDF file on a remote server.
    3 distribute the PDF file to the user in a pop-up window.

    Thank you.

    Here you go
    https://www.EverNote.com/shard/S48//sh/ae8f58be-c4d3-4AB9-8F94-3e01d0e967d0/923ab115aca22fd1e2fccbf6321cbf09

    Timo

  • Requirements of VMWare Lab Manager

    Hello!

    I'm trying to put together a proof of concept for my business help to reach an agreement to buy and implement of Lab Manager, but am having a hard time getting real answers on a licence!  Maybe I'm reading just the documents wrong or something, but here are my questions:

    (1) VMWare Lab Manager does support ESXi?  If so, why do I use instead of ESXi ESX when all management is made by the end before (Lab Manager or vCenter Server)?  ... I have no need of HA or VMotion.

    (2) do I need for 3 products license?  For example, Lab Manager, vCenter Server, and ESX server?

    I read in a PDF document that vCenter Server is not a must but could take no ESXi, but a person in chat support told me that Lab Manager backed ESXi but necessary vCenter Server.  I'm a bit confused.

    What is the deployment scenario recommended for an environment with 1 physical host (to start) but plans to expand to 3-5 in the year?

    Thanks for your help!  Sorry to ask what I am sure is answered somewhere on the website, I just couldn't find where and it seems that the name of the product seems to be different depending on what you're looking at (ESX Server Infrastructure =?)

    -Jesse Reinhart

    Hi Jesse

    (1) lab Manager does not support ESXi.

    (2) Yes Lab Manager 3.0.2 requires the current version VC, it does not work on stand-alone host. Director of the laboratory 2.5.x support stand-alone host.

    You need a configuration that Lab Manager-->--> ESX VC even for single host currently.

    Hope that helps

    John Shao

  • Does anyone use the project manager?

    Hello

    I have printing that Manager project does not serve much. I use CS4.

    However, here is my attempt.

    I worked on a project for a friend, and as I was going out of town, he wanted to do a little

    editing on the project with his computer.  It also has the CS4.

    So, I used the project manager and made the following choices:

    1. I clicked on: "Collect files and copy them to the new location."

    2. I clicked on and chosen: "exclude the unused Clips.

    3. I clicked and selected: "Include preview files, 'Include audio conform files' and 'Multimedia files Remane to match clip names'."

    4. I made the destination of my office project.  He showed the 51 concert in the project.  Then I transferred all of my office to help connect an external hard drive with an eSADA.

    When my friend all this on drugs on his hard drive and opened his Pro CS4 the Prem, the project looked just like he did on my computer, with the exception: all the video clips were 'offline' of course, they were originally on one of my hard drives, but not "hard drive project.

    I expected the project manager to copy the files from all three of my drives with everything else.  In addition, some of the music was absent (offline).

    I expect too much from the project manager?  It will copy all files, audio, video, F / x all hard drives etc?

    I'd appreciate help here how to use the project manager and get everything.

    Thank you, Tom

    They are in offline mode because they aren't in the same place they were before - your office.

    Your friend will have to connect the media.

  • CS and the extension manager extensions

    Someone please tell me I'm wrong...

    (1) extensions to CS cannot be installed using the Extension Manager.

    (2) as this screenshot shows, it is possible to disable the installation of the extension manager:

    2011-01-14_0015.png

    These two facts spells trouble. I could be the creation of Setup programs that will not work because a user cannot wear the extensions Manager and there is no way around this...

    If the extensions manager was made mandatory for CS Extensions, the extension manager installation should be mandatory as well...

    Also, is there more than one place where could be installed the extensions Manager (if it is...)?

    Substances

    Substances,

    There is a checkbox in the Export Wizard, when it is checked, the zxp

    (file format used by the extensions Manager) will be first decompress the

    same directory of export where you select to export zxp.  The extension in

    the unzipped file is signed and is ready to be copied in the

    file extension for the deployment of the release.  So you should be able to

    to integrate your

    own program installation (or Setup process)

    Thank you!

    Lee

  • How to copy an iPhoto Library AND photos

    With the help of iPhoto Library Manager I made a copy of my iPhoto library to a new external drive, but I noticed that when I opened the library copied, the photos it contains are always referenced to the original photos, no copies on the new drive, as I had hoped.

    If as expected, how a copy an iPhoto Library AND photos referenced to a new location, on an external drive, as is any independent on the new drive?

    Thank you

    Geoff

    Simple:

    Go to your pictures folder and find the iPhoto library here. Drag it to the external hard drive. It will make an exact copy it

    Fact.

    Warnings: the player must be directly connected (USB, lightning etc.) and Mac OS extended (journaled) format

    Are you running a Managed or referenced library?

    A managed, library is the default setting, and iPhoto copies the files in the iPhoto library during import. The files are then stored in the library package

    A referenced library is where iPhoto does NOT copy the files in the iPhoto Library when importing because you have made a change to iPhoto-> preferences-> advanced. (You unchecked the option to copy files in the library to import) The files are then stored wherever you put them and not in the library package. In this scenario, you are responsible for the management of files.

    If you have a library that is referenced, then it is much more complicated.

  • No sound Satellite P200

    In the last days I get no sound on speakers embedded on my P200 running Vista Ultimate. No problem before. To check Device Manager, even made a driver roll back, but still nothing.

    Everything seems correct in the control panel etc.

    Hi Cathal

    It would be great to know if you have solved your problem.

    But if you are still looking for a solution so you can try this:

    Go to Device Manager and remove two high definition tree of system devices PCI devices
    Remove the driver Realtek sound, and then restart the laptop.

    After restarting again the Vista operating system should automatically recognize the new device.
    I think that you have to restart again once you would be able to install the audio driver but I m not 100% sure.

    Anyway, the new installation driver sound would be needed to recover the sound

    Best regards

  • How to install the display on the satellite Pro 4600 driver?

    I can't find the option to do so. Can someone explain to me on how I can do this?
    I don't see an option so on the control unit of the device.
    What option do?

    Thanks in advance!

    Any help will be greatly appreciated.

    Post edited by: Thierry

    Hello

    The recent display driver more, that you can download from the Toshiba site.

    http://EU.computers.Toshiba-Europe.com/cgi-bin/ToshibaCSG/download_drivers_bios.jsp

    System adapters - Device Manager - display made control panel right click on the graphics controller driver update or install the driver.
    In this case, the source of the driver is the place of graphic driver download.

    Good luck

    Good bye

  • Satellite Pro A100 - recovery mode sleep with keyboard or media remote

    Hi guys

    I have devoted my Satellite Pro A100 to be a media center which is located under the TV and can play media network and DVD etc..
    It is using Vista.

    I want to set up, is that the lid is closed 24/7 365 days and when I want to use I just press "SLEEP" or power button on the remote control or the keyboard and it fires up ready for action.

    POINT TO THE NOTE. I did it successfully with my OLD Tecra M3. However, was too slow for vista and media center

    However, I put the power settings I want etc, close the cover nothing and activated standby hybrid (favorite sleep).

    Now I CAN put it to sleep with the remote control or the multimedia keyboard. BUT I can wake up?... NO!. I thought about everything... went to the Device Manager and made sure that all the options for the remote control and keyboard and USB receiver are set to WAKE FROM SLEEP. The only thing to wake up it is the power button - which defeats the purpose of it sitting there like a dvd player.

    awake when the remote control and keyboard function very well - I made sure that the batteries are charged.
    I have the latest version of the BIOS and speaking of BIOS there is no option power S3 I noticed, but then there were not on the M3 and it worked very well in terms of sleep and wake up with the IR.

    I come to the forum because even though I know that some older systems will not work with vista - IF the M3 will work - I'm sure that the A100 twice as new and powerful.

    Has anyone had this before - that I missed it must look me in the face.

    Thanks in advance.

    PS Also lately the touchpad played upward IE left and right clickers Exchange feature so one second your work as normal the next minute you click left and right clikc menu appears. Reset the synaptic reinstalled - rebuilt - BIOS - no difference.

    When I worked in management for a large company when it started happening was not good news - it's a bad news?

    Hello

    I m not very well why it doesn t on your Satellite Pro A100 and why it works on M3.
    But the fact is that the Satellite Pro A100 doesn t support the FIR (Fast InfraRed) port and the
    Tecra M3 supports the fast infrared port.

    Maybe this could be the reason why you can not activate the laptop using the infrared remote control multimedia.

    Welcome them

  • BOOTMGR is missing: no installation or recovery disk!

    Hello.
    I have a HP Pavilion dv6000 and run Windows Visa Home Edition.

    I wanted to restore my laptop to its factory settings, but the Recovery Manager would not work. When I click on it it would just restart the computer without anything else happening. I then right click on computer > manage > Disk Manager and made the recovery partition active. When I restarted the computer it has started to show:
    BOOTMGR is missing
    Press Ctrl + Alt + Delete
    Of course, brings us to the same message after restarting the computer you. I can't access the F8 button. F10 only works (Bios). I do not have a recovery or installation CD because it came not with the laptop when I bought it.
    Is there anyway that I can change the active partition in drive C, this deactivation of the recovery partition? I read that it was possible to access Disk Manager cmd window, but I do not know how to access since the key F8 does not work (makes just a bipping sound when you press on)?
    I'm also abroad so cannot send my laptop to HP for fixed it. Any ideas?
    Thanks for your suggestions.

    Scroll down the page and get > Bootable CD ISO and > ImgBurn to burn the iso image to cd, a guide on the use of ImgBurn to write an ISO on a disc is here. Once created, boot from it and allows you to change the active partition.

  • Need help! G500 Bluetooth problem

    The bluetooth on my Lenovo g500 (8.1 windows) no longer works. Other devices don't figure it out and the laptop itself not either connect with any device! What should I do?

    Yes, I tried

    What happens is that after that I uninstalled the bluetooth driver, it uninstalls successfully, this icon disappears too but then after a few moments, pilots reappear by themselves in the Manager and made the bluetooth icon in the taskbar on my desk

    I tried reinstalling the drivers, restarted my laptop several times but nothing works

    Also, I first installed the drivers provided by the dealer where I bought the laptop.

    I also tried to install from the lenovo Web site

    No work

    Now I've found one for Windows 8.1 lenovo Web site, but I can't really say if it will work or not until it downloads and this is a very large file.

  • Problems of memory of bike E

    Pre-installed applications are pretty much limited to those developed by Google and Motorola, but yes, there are some bloatware. I don't have really any use for Google Chrome or migrate, but they are preinstalled.

    Again, I ask you please try to search and if she can't find a job then...

    Many discussions are already there on this memory problem...

    Here is the official link, please refer to it...

    https://forums.Motorola.com/posts/1a2ff55715

    There was a thread on our forums Manager has made it clear on the issue...

    https://forums.Motorola.com/posts/d7fa6c62e4

  • Range of display on the right click function

    I am currently using VIPM to install reusable code in LabVIEW palettes. I notice that with many functions, LabVIEW, I can right-click and have the ability to click to view the range where this function appears. I have not found how I can achieve this for my own additions. Is this possible?

    For the benefit of anyone else interested in this issue, I found the answer now with Thoric in the recent Cambridge LabVIEW user group. That I had was the "Default" Palette to the class or library that is located on the General Settings page.

    Either way, however, the latest version of the Package of VI Manager, this made it easier and this can now be set when creating a package. See Add the library Palette or class.

  • Format a PC

    Hello

    I have a laptop HP pavilion g6 with windows home premium x 64

    When I bought a few years ago, I don't have a windows installation CD

    Now, after a few years, I bought an external hard drive to back up the laptop and I want to do a format

    My question is how can I do this with a CD?

    Thanks to you two, but I actually found a simple solution...

    The Recovery Manager program made just for me...

    I just ran, and he has just recovered it until the day that I bought it.

Maybe you are looking for