help with my HorizontalFieldManager & EditFields on the same line, 2nd column is not displayed

Hi all, I've written a bean (called LabelAndEditField) that sets out a label and editfield as follows

someLabel

_________________

|                                 |

-----------------------

It seems to work perfectly when it is the only component on a line of a

VerticalFieldManager

now I want to reuse this compenent such that I can have a screen that looks like

someLabel another label

______________              ______________

|                                 |             |                                |

--------------------------             --------------------------

and perhaps a third column.

However, when you add my components of LabelAndEditField, the 2nd does not appear

I used a HorizontalFieldManager and make

HFM HorizontalFieldManager = new HorizontalFieldManager();

HFM. Add (new LabelAndEditField ("someLabel"));

HFM. Add (new LabelAndEditField ("another label"));

then I just on the screen

Add (hfm);

but it does not show my second column, the second component of the LabelAndEditField

Here is the snippet of code below, some can please help me get this to display

(Sorry, that the code of my insert is wacked)

public class LabelAndEditField extends VerticalFieldManager
{
    private EditField _editField;

    public LabelAndEditField(String label,
                             String initialValueOfTextField,
                             int maxChars,
                             long style)
    {
        super(NO_HORIZONTAL_SCROLL);

        add(labelField);

        HorizontalFieldManager textMgr = new HorizontalFieldManager(
                Manager.NO_HORIZONTAL_SCROLL
                | Manager.NO_HORIZONTAL_SCROLLBAR);

        _editField = new EditField("", initialValueOfTextField, maxChars,
                     style | EditField.NO_NEWLINE | EditField.FOCUSABLE
                     | EditField.NON_SPELLCHECKABLE
                     | Field.FIELD_VCENTER | Field.FIELD_LEFT);

        textMgr.add(_editField);

        add(textMgr);

    }

}

and the code that adds as that on the screen

super(NO_HORIZONTAL_SCROLL); // this is a VerticalFieldManager

HorizontalFieldManager rowMgr =
     new HorizontalFieldManager(Manager.NO_HORIZONTAL_SCROLL
             | Manager.NO_HORIZONTAL_SCROLLBAR);

LabelAndEditField col1=
       new LabelAndEditField("some label","initial value",12,Field.READONLY);

    LabelAndEditField col2=
       new LabelAndEditField("another some label","initial value",12,Field.READONLY);

rowMgr.add(col1);
rowMgr.add(col2);

did anyone see anything wrong with that?

As you can see for yourself, there is no place for the mktShare.  Try to go with FlowFieldManager and no HorizontalFieldManager as a container for your gadgets MyLabelAndEditField and see

There is another possibility:

The key in the code I provided is the super.layout (myWidth, maxHeight).  This myWidth tells your EditField its maximum size in pixels.  If you want to further restrict the domain, you have several options.  The only problem is - if you limit it too much, you will not be able to see the rest of the field.  To solve this, wrap your EditField (in which you now don't have to override the layout) in a HorizontalFieldManager (HORIZONTAL_SCROLL) (all this inside your MyLabelAndEditField) and limit the Manager rather than the field itself.  Then your customer will be able to scroll through the left field and right.

In order to limit your HorizontalFieldManager, give him the width that you want in pixels (add that, as a parameter to the constructor of your MyLabelAndEditField) and substitute his sublayout like this:

HorizontalFieldManager textMgr = new HorizontalFieldManager(Manager.HORIZONTAL_SCROLL | Manager.HORIZONTAL_SCROLLBAR) {
  protected void sublayout(int maxWidth, int maxHeight) {
    int myWidth = Math.min(_desiredWidth, maxWidth);
    super.sublayout(myWidth, maxHeight);
  }
};

Thanks to his style HORIZONTAL_SCROLL, the infield will be almost infinite width, so the EditField inside fortunately "will display" all his characters.

Then, when you design your MyLabelAndEditField, give him a maximum pixel value.  Say, you want three areas in a row.  Take your Display.getWidth (), subtract the margins planned, divide by 3 and pass that value to each of these areas.  Then add them to a HorizontalFieldManager (line2mgr in your example) and check the result.

You seem to be competent enough to easily integrate my illegible bubbles in your code - let us know the results.

Tags: BlackBerry Developers

Similar Questions

  • Need help with creating a Package in the same way

    Hi all


    I have script for the file package. It's good work, but I need the package on the same path instead of on desktop with file name.

    As if the work of the file xyz.idd in D:\ Projects\Today\

    I need same location (D:\ Projects\Today\) with the name of the folder as file name (xyz)

    Can you change the code, I tried to change but it does not work.

    var to = new File ("~/Desktop/package_folder/");
    flag of the var = Folder (to) .create ();

    var copyingFonts = true;
    var copyingLinkedGraphics = true;
    var copyingProfiles = true;
    var updatingGraphics = true;
    var includingHiddenLayers = true;
    var ignorePreflightErrors = true;
    var creatingReport = true;
    var versionComments = 'comment ';
    var forceSave = true;

    If (flag = true) {}
    () app.activeDocument.packageForPrint
    TO
    copyingFonts,
    copyingLinkedGraphics,
    copyingProfiles,
    updatingGraphics,
    includingHiddenLayers,
    ignorePreflightErrors,
    creatingReport,
    versionComments,
    forceSave
    );
    }

    Thanks in advance

    Kind regards

    Siva

    myDocument var = app.activeDocument;
    var myDocName = myDocument.name;
    Temp=myDocName.replace(/\.indd/g,""); "
    var myFileNme = temp.toString ();
    var myDocument.filePath = myFolder.
    var to = new file (MyFolder + "/" + myFileNme + "/");
    flag of the var = Folder (to) .create ();
    var copyingFonts = true;
    var copyingLinkedGraphics = true;
    var copyingProfiles = true;
    var updatingGraphics = true;
    var includingHiddenLayers = true;
    var ignorePreflightErrors = true;
    var creatingReport = true;
    var versionComments = 'comment ';
    var forceSave = true;
    If (flag = true) {}
    () app.activeDocument.packageForPrint
    TO
    copyingFonts,
    copyingLinkedGraphics,
    copyingProfiles,
    updatingGraphics,
    includingHiddenLayers,
    ignorePreflightErrors,
    creatingReport,
    versionComments,
    forceSave
    );
    }

    Mi_D

  • How to choose the Department with employees in the same line?

    Hello world

    I need to make this request,

    Suppose we have 2 departments with n used on each Department

    I need to select the departments with only 2 employees in the same line, example here

    Department Name of Department Employee1 Employee2
    10HUMAN RESOURCESMarcSteve
    20HEPaul
    30New Department
    40FinanceJeanMichael

    This query below did not work because it only displays the first employee, but I need to display 2 employees (same as the above table)

    select
    deptno,
    (select ename from emp, dept where rownum =1 and emp.deptno = dept.deptno) employee1,
    (select ename from emp, dept where rownum = 2 and emp.deptno = dept.deptno) employee2
    
    from dept;
    
    

    ...

    I did this, but with the function returning the Emp2Dep1 Emp1Dep1

    function get_ename(p_dept number,p_col number)
    return varchar2
    is
        v_ename varchar2(4000);
        v_first boolean := true;
    BEGIN
            select ename
                  into v_ename
                  from
                      (
                      select ename, rownum as rn
                      from (
                            select ename
                            from emp ,dept
                            where    emp.deptno        = p_dept
                            order by 1 asc
                            )
               
                      )
                  where rn = p_col;       
              
    
         return v_ename;
    END;
    
    

    and simply put

    select
    get_ename(deptno ,1 ) employee1,
    get_ename(deptno ,2 ) employee2
    from dept;
    
    

    Is there a better way to do it?

    NB: database 11g

    Thank you

    Select the Department, employee1, employee2

    (select Department, name, cnt

    (name, department, row_number (select) at the NTC (partition by order of the Department by null)

    employees

    )

    where NTC<=>

    )

    Pivot (max (name) of the cnt (1 as employee1, 2 as employee2))

    order by Department

    DEPARTMENT EMPLOYEE1 EMPLOYEE2
    10 Marc Steve
    20 Paul -
    30 - -
    40 Jean Michael
    50 Alpha Beta

    Concerning

    Etbin

  • EditField and checkboxfield on the same line

    public CheckFileScreen()
        {
            vfm = new VerticalFieldManager();
            left = new HorizontalFieldManager( Field.FIELD_LEFT);
            right = new HorizontalFieldManager( Field.FIELD_RIGHT);
            _Id = new EditField("Id : ", "", 6, EditField.FILTER_NUMERIC);
            _check = new CheckboxField("check", false);
                    left.add(_Id);
            right.add(_check);
            vfm.add(left);
            vfm.add(right);
            add(vfm);
            add(new SeparatorField());
        }
    

    on my above code tries to _id and _check on the same line, but the screen has been mess up

    +---------------

    | ID:

    | # check

    +----------------

    I want to create has been

    +----------------------

    | ID: # check

    +-----------------------

    could someone help me with this?

    This is the first time make app with GUI

    Gentlemen.

    slow down, please!

    Absolutely, totally useless any Manager available personalized for that! In order to organize two or more fields in a 'line', you just all of them to the same HorizontalFieldManager! The manager then places them from left to right in the order that you add them.

    That said - you have a slight problem in your EditField. EditField is "width-hungry" - it consumes the entire width, it is given, do not leave anything for the rest fields. To combat that, to deceive him into thinking he's got less space. We will give him what he needs to label 6 larger figures (s '8' or '9's, not '1') and a space for the padding. We will then have something like:

    _Id = new EditField("Id : ", "", 6, EditField.FILTER_NUMERIC) {
      protected void layout(int width, int height) {
        Font myFont = getFont();
        int myWidth = myFont.getAdvance(getLabel()) + myFont.getAdvance("8") * 6 + myFont.getAdvance(" ");
        super.layout(Math.min(myWidth, width), height);
      }
    };
    _check = new CheckboxField("check", false);
    HorizontalFieldManager hfm = new HorizontalFieldManager();
    hfm.add(_Id);
    hfm.add(_check);
    add(hfm);
    

    Enjoy!

  • EditField &amp; ButtonField on the same line

    First of all, I would like to apologize in advance if there is already a resolution for this problem, I searched google on and off for a few days while working on other parts of my application, but have been unable to find advice.

    I'm not new to programming, but I am relatively new to java and very new to the BlackBerry that's why I worked on something relatively simple, so I can get used to the user interface of programming programming.  A question, I have been unable to solve is how to place an EditField and a ButtonField on the same line with ButtonField sitting against the margin and right the EditField take the place of the left margin at the beginning of the ButtonField.  Graphically, that's what I'm trying to achieve:

    | [- EditField-] [- ButtonField-] |

    I tried to place the two fields inside the same HorizontalFieldManager and placing each field it contains is own Vertical or HorizontalFieldManager.  I also tried to use the FIELD_LEFT / FIELD_RIGHT styles, but can not find a way to stop the EditField of push of the ButtonField off the screen and using the width of the entire line for himself.

    I begin to suspect that I need to learn how to code a custom field Manager, this is the case, or is there something much more simple that I'm missing?

    Thanks in advance,

    Russ.

    The following Threads must explain what is happening here and give you example of code that will help you overcome the problem:

    http://supportforums.BlackBerry.com/T5/Java-development/BasicEditFields-won-t-show-up-in-HorizontalF...

    http://supportforums.BlackBerry.com/T5/Java-development/custom-field/m-p/392585#M76156

  • On my laptop, my google toolbar sharing the same line with the menu bar, I want that on my desktop PC, all have XP w/SP3

    On my Toshiba laptop that my Google toolbar is on the same line as the menu bar, I want that on my Dell desktop computers. All have Xp w/SP3. All computers are olde, and I am rich with time, but poor in cash. Thanks - L

    Hello

    What version of internet Explorer that you are using?

    You can unlock the toolbar then click, hold and drag the toolbar on the same line of the menu bar.

    Unlock toolbars to customize their

    Hope the helps of information.

    Please post back and we do know.

  • CheckboxField, on the same line with OS6

    Hello

    I'm testing my apps for compatibility with OS6.  I discovered that if I have more controls, and then another on the same line, behavior went from OS5.  The first control's display while the other controls are moved outside of the screen.  Any idea on how to solve this problem while keeping compatibility?  Here's the code I'm referring to:

    HorizontalFieldManager hfmOperator = new HorizontalFieldManager(HorizontalFieldManager.USE_ALL_WIDTH);
    
    int intRightSpace = Display.getWidth()/10;
    
    LabelField lblOperator = new LabelField("");
    lblOperator.setFont(Font.getDefault().derive(Font.PLAIN, 18));
    lblOperator.setPadding(0, intRightSpace, 0, 0);
    hfmOperator.add(lblOperator);
    
    chkADD = new CheckboxField("+",  Param.boolActiveADD);
    chkADD.setFont(Font.getDefault().derive(Font.PLAIN, 24));
    chkADD.setPadding(0, intRightSpace, 0, 0);
    hfmOperator.add(chkADD);
    
    chkSUB = new CheckboxField("-",  Param.boolActiveSUB);
    chkSUB.setFont(Font.getDefault().derive(Font.PLAIN, 24));
    chkSUB.setPadding(0, intRightSpace, 0, 0);
    hfmOperator.add(chkSUB);
    
    chkMUL = new CheckboxField("*",  Param.boolActiveMUL);
    chkMUL.setFont(Font.getDefault().derive(Font.PLAIN, 24));
    chkMUL.setPadding(0, intRightSpace, 0, 0);
    hfmOperator.add(chkMUL);
    
    chkDIV = new CheckboxField("/",  Param.boolActiveDIV);
    chkDIV.setFont(Font.getDefault().derive(Font.PLAIN, 24));
    chkDIV.setPadding(0, intRightSpace, 0, 0);
    hfmOperator.add(chkDIV);
    
    add(hfmOperator);
    

    The only way I could get to this day is to override the method of layout in the CheckboxField and spend a fixed width to the super method:

    protected void layout(int width, int height) {
        super.layout(100, height);
    }
    

    The problem with this approach is that the width of the content can vary from a device to according to the size of font by default, etc. and it may be possible to try to force a specific width.

  • How to export data to excel that has 2 tables with the same number of columns and the column names?

    Hi everyone, yet once landed upward with a problem.

    After trying many things to myself, finally decided to post here...

    I created a form in form builder 6i in which clicking on a button, the data gets exported to the excel sheet.

    It works very well with a single table. The problem now is that I cannot do the same with 2 tables.

    Because the tables have the same number of columns and the columns names.

    Here are the 2 tables with column names:

    Table-1 (MONTHLY_PART_1) Table-2 (MONTHLY_PART_2)
    SL_NOSL_NO
    MODELMODEL
    END_DATEEND_DATE
    U-1U-1
    U-2U-2
    U-4U-4
    ..................
    ..................
    U-20U-20
    U-25U-25

    Given that the tables have the same column names, I get the following error :

    402 error at line 103, column 4

    required aliases in the SELECT list of the slider to avoid duplicate column names.

    So how to export data to excel that has 2 tables with the same number of columns and the column names?

    Should I paste the code? Should I publish this query in 'SQL and PL/SQL ' Forum?

    Help me with this please.

    Thank you.

    Wait a second... is this a kind of House of partitioning? Shouldn't it is a union of two tables instead a join?

    see you soon

  • How can I work with two icloud ID on the same pc?

    How can I work with two icloud ID on the same pc?

    Define "work".

    What exactly do you want to accomplish?

    You can use the iCloud Panel to connect to iCloud account and use a browser to go to icloud.com and sign in with another account.

  • 2 phones connected to the same line with PAP2

    Hello

    Is it possible to connect a phone to the first port, a second, and use both in the same line?

    I configured and only works with a single line.

    Thank you

    Yair.

    Hello

    No, this is not the right way. The first port belongs exclusively to recording the line1, second port exclusively to recording of line 2.

    If you want two phones (such as another in the bedroom lounge) ringing on incoming call, simply use the "splitter" to make the phones at the same time and that's it - SPA/PAP Traffic has enough power to operate up to 3 analog telephone devices on each of the ports. I used to have 2 analog phones in parallel on (the only one) FXS ports of SPA-1001 and it works beautifully.

    PS: mae good course use you only 2-wire cable (internal thread) to connect the PAP2T FXS1 port and the phone (s). The 4-wire cable may make some analog phones crashing the device PAP2T IDE oucederomsurlesecondport FXS1.

  • I need help to unite 2 users on the same CC account, can someone help me?

    I need help to unite 2 users on the same CC account, can someone help me?

    Since this is an open forum, not Adobe support... you must contact Adobe personnel to help
    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific time) <==> NOTE DAYS AND TIME

    Creative cloud support (all creative cloud customer service problems)
    http://helpx.Adobe.com/x-productkb/global/service-CCM.html

  • After hosting my site created with adobe muse on a ftp server, can I change my site on muse adobe later and update it on this same server ftp with the same domain name and do not have to pay for hosting again?

    After hosting my site created with adobe muse on a ftp server, can I change my site on muse adobe later and update it on this same server ftp with the same domain name and do not have to pay for hosting again?

    Yes, no extra accommodation payment is required. After editing your site and savings, click download file to the host of VTT... The info should auto fill with the same information that you used to download the site the first time. You can choose to download only files "changed" or "all files". Click OK and the old files will be overwritten.

  • How to better master with this model s/n, sides IN and OUT in the same line.

    Hi all!
    I'm just facing some old historical table where, to the transaction recorded in the same line, something like:

    column name
    ==============
    ref_no,
    x_id,
    product_id,
    product_amt,
    -* IN part
    in_flag-(IN)
    in_customer,
    in_address,
    -* PORTION
    out_flag-(OUT)
    out_customer,
    out_address

    Nice shipping biz where we can have the two sides met in the same line, they have same value for IN and OUT_flag = actual values 'IN' and 'OUT', woou!
    I really expect to have this table in different model where a line is an entry, probably with PK = ref_no + in_out_flag.
    But it looks like I can do anything on this design, and now I choose upong xactions request entry and EXIT, IN/OUT fixing portions on a common part with the UNION. This, the only way I can see how to solve this problem, or I'm not right? And I need to pack all in the stored procedure.

    Appreciate your comments how to do this, I'm really new to Oracle, however have some exp.
    And comments about these models db as well! -).


    Best
    TR

    I don't understand what problem needs to be solved.

    What criteria an independent observer would conclude that a correct solution has been posted.

    Published by: sb92075 on September 11, 2010 17:19

  • How to put the button on the same line

    I am having some problems with the buttons. I have the main screen with a verticalmanagerfield parent, who has two sons a richtextfield and an editfield (these two are the same on both of the gpsdemo)

    I want to put 3 buttons under the sons of two field and these 3 buttons that we're going to be son of verticalmanagerfield, but I can't put them on the same line

    I'll show you two pictures what I mean

    first image: I see now

    second image: what I want

                HorizontalFieldManager hfm = new HorizontalFieldManager()
                {
                    protected void sublayout(int width, int height)
                    {
                        Field field;
                        int numberOfFields = getFieldCount();
                        int x = 0;
                        int y = 0;
                        width=250;
                        height=50;
    
                        for (int i = 0;i < numberOfFields;i++)
                        {
                            field = getField(i); //get the field
                            setPositionChild(field,x,y); //set the position for the field
                            layoutChild(field, width, height); //lay out the field
                            x += 120;
                        }
                        setExtent(width, height);
                    }
                };
    
                 hfm.add(new ButtonField("Button 1"));
                 hfm.add(new ButtonField("Button 2"));
    
  • Two RichTextFields on the same line

    I am writing two RichTextFields in the same line, but one of them with a font in bold and plain text for the other. I do this, but for some reason any the second richtextfield is not shown in my screen. I have no idea what I'm doing wrong...

    myFontNegrita = Font.getDefault () .derive (Font.BOLD, 16);
    myFont = Font.getDefault () .derive (Font.PLAIN, 16);
          
    hfmHoraInicio = new HorizontalFieldManager();
    labelInicioAplicacion = new RichTextField ("my text:", Field.READONLY |) Field.NON_FOCUSABLE);
    labelInicioAplicacion.setFont (myFontNegrita);
           
    textoInicioAplicacion = new RichTextField ("blablabla", Field.READONLY |) Field.NON_FOCUSABLE);
    textoInicioAplicacion.setFont (myFont);
           
    hfmHoraInicio.add (labelInicioAplicacion);
    hfmHoraInicio.add (textoInicioAplicacion);

    Add (hfmHoraInicio);

    Thanks in advance.

    I guess that the RichtTextField takes all the available horizontal space by default. Perhaps the style RichtTextField #USE_TEXT_WIDTH help?

Maybe you are looking for

  • Is it possible to display a video in a video?

    Is it possible to view two videos at the same time in FCPX?  For example a "display in a screen? I'm showing the action and someone explaining the action at the same time. Instead of having a physical screen beside the person (who does not work becau

  • CPU temp is-128C after the resumption of the mode S3 Sleep

    Hello As says my title, my temp cpu bed-128 C after waking mode S3 sleep. This affects my fan control, and while not particularly dangerous, it is annoying as my fans are set to 100% and do not return to their modes of thermal cruise. However, when I

  • Restore Failed - reason 0xd000001e

    I have an Acer 5150 and bought the "boot floppies" so that I can restore the system.  However, the error noted in the box 'Title' keeps coming back.  No idea what this means and how I can fix this?  My laptop is completely unusable at the moment.

  • How to open 2 windows in Windows Explorer

    On Windows XP, you can display two Windows Explorer Windows at the same time. I need this option for organzingfiles, moving files or specific items, etc. I can't understand how to do this (i.e. show 2 explorers window at the same time) in Windows 7.

  • BlackBerry Smartphones PRIV begins beeper PIN screen on reboot

    I have a 4-PIN number on my PRIV. Sometimes in the night the PRIV will restart (probably install updates, I guess) and after reboot, it will ask for the PIN before it starts up Android (which is normal). My question is after 2 minutes of PIN code scr