How to justyfing several fields in a Manager?

What happens if I have three fields of label in a horzontal Manager and I want to do something like this:

[Field1 Field2 Field3]

Where field1 is left justified and fields2 and 3 are justified to the right.  Any ideas?

Create your own custom handler and position fields as you wish in the subLayout() method, with the help of setChildPOsition().

There is an example of a Manager in the developer's guide.

Tags: BlackBerry Developers

Similar Questions

  • touch events for several fields in the Manager of several

    In my application... I have a vertical field (VFM) Manager in the screen.

    In this optimization of resources, I inserted 3 manaagers:

    (1) District Manager hfmHeader horizontal (in which I added 1 label (NON_FOCUSABLE) and 1-2 Btns according to the conidtion (tuochEvent FOCUSABLE and overrried all in initlilsing it).)

    (2) District Manager vertical ListField container or TextField or LabelField vfmManager in accordance with the condition.

    ((3) District Manager horizontal hfmButtons containing 6 btns... all tuochEvent FOCUSABLE and overrried initlilsing while the).

    public int getFieldAtLocation (int x, int y)
    {
    XYRect rect = new XYRect();
    int index = getFieldCount()-1;
    While (index > = 0)
    {
    getField (index) .getExtent (rect);
    If (rect.contains (x, y))
    break;
    -the index;
    }
    return to index.
    }

    Second, the click event try something like:

    protected boolean touchEvent(TouchEvent event)
    {
       switch( event.getEvent()  )
       {
            case TouchEvent.CLICK:
              int index = getFieldAtLocation(event.getX(1),
                                             event.getY(1));
              // Ignore click events outside any fields
              if (index == -1)return true;
              Field field = getField(index);
              if(field.equals(bitmapField))
              {
                System.out.println("Bitmap Clicked");
              }
            return true;
       }
       return super.touchEvent(event);
    }
    

    Even when I am using above solution, can't scroll. and click event of the hfmButtons buttons aren't the gt performed.

    Second... If I don't stand... I am able to scroll and executed at least the first 3 buttons click event.

    How can I implement for each button click event in any Manager? Is this possible...

    Can someone please help in this regard. Any suggestion or if possible code snippet will be appreciable.

    Thank you

    Use the snippet for each manager of...

    case TouchEvent.CLICK:
    India = getFieldAtLocation (event.getX (1),)
    event.getY (1));
    If (India! = - 1) {}
    Field fm = getField (India);
    {if (FM. Equals (vfmMain))}
    int index1 = vfmMain.getFieldAtLocation (event.getX (1),)
    event.getY (1));

    If (index1 >-1) {}

    Field = vfmMain.getField (index1);

    check field is instance of the field you want

    {if (Field.Equals (footerManager))}
    Container.isFooterManager = true;
    int index2 = footerManager.getFieldAtLocation (event.getX (1), event.getY (1));

    Search fields in the Manager of this...

    } ElseIf... {

    go on the same cehcking

    } ElseIf {}

    ... like this, go to the control...

    }

    }

  • How to fill several fields a...?


    I'm working with Acrobat 9 and try to change some fields in an existing PDF, I. I have some fields that repeat (EX: social security #) and I am trying to do it where it just fill in once and it will appear on other parts of the document. I was not the original developer of this PDF form to fill out, and the previous person has several fields that populate only randomly with information/data, when a particular field is completed. HELP PLEASE!

    The key thing to understand is that the fields with the same name will automatically have the same value. So, if you give it them the same name. If you don't want it to happen, assign each field a unique name.

  • How to get SEVERAL fields showing upwards at the point of a SINGLE page?

    Hello

    I have a page as a select list item (for example, name). And I want to have * 3 * columns LastName, FirstName MInitial appearing in the list, select the database.

    Is this possible? I don't want to use the 3 elements of the page to let the user select 3 times (ie: LastName, FirstName and MInitial respectively).

    The return_value could be just one or three values.

    The following is my code, BUT I need a * 3 * display_value:

    Select LastName display_value, PeopleId return_value
    of PEOPLETB
    order by 1

    Thank you very much
    Helen

    OK, let me see if I get this right:

    AFTER the name Mname field and before '.' you need the hose doiuble | ...

    If your query is the following:

    Select Lname | ', ' || Fname | Mname | '. "as display_value, PeopleId as return_value '.
    of PEOPLETB
    where PEOPLETYPE ('i', 'HERE', 'IF')
    order by 1

    (Sorry, had MInitial not for the element name mName)
    Don

  • How can I get the position of a field in a Manager?

    Hi all

    I just want to know that how I can the position of a field in a Manager (Vertical or flow)?

    If I get the x, position y, I can do a pop-up screen depends on this position...

    Can someone help me solve this problem?

    Thank you very much.

    Welcome to the forums.

    I use getFocusRect to fetch the XYRect of the target field. You can get the details from there.

  • How to get the field at any time a vertical field Manager?

    Hi guys. In the application, that I'm working on, I came across a bit of a challenge.

    Basically I have a vertical field Manager ful of custom components.

    Basically this custom components, draws the user name, some other info and pictures of the user related to their account.

    It all works very well, but what I'm trying to do is to get the exact field on the vertical field Manager at any time. You see, while it displays the image of the user, I download from a Web server (and it will display a picture by default while it is downloading). So what I'm trying to do is go to the correct custom component of the vertical field each time Manager, so I can quickly change the image is correct, once I get the correct uploaded image. The manager of vertical field is called via the standard method.

      VerticalFieldManager vfm = new VerticalFieldManager(VERTICAL_SCROLL|VERTICAL_SCROLLBAR) {
    
    protected void sublayout(int w, int h) {
        super.sublayout(480, Math.min(240, 360)); 
    
    }
    
    };
    
    for(int i=0; i< contacts.length; i++)
    {
    //Contacts is an array of my custom component. I am just calling it
    contacts because it basically is a list of contacts.
    vfm.add(contacts[i]);
    }
    
    add(vfm);
    

    Everything works well for me except a way to get the correct field on the vertical field manager. So that I can

    Run it in a contact, and then reset the image.

    Can anyone help with this?

    Thank you

    I suggest that you give to your download manager - a reference to the contact that you update, if networking is done, you can refresh it.

    except if you develop for a device of some I would be careful with the absolute values like 480 btw

  • How to disable the password field in the management of Oracle users

    Hello

    How to customize the field password on the user - define the uneditable form? I tried customizing the forms on this field, but it did not work. Can we have an idea if this field can be customized at all

    Thank you in advance!

    See if it works for you. I tested and it's ok

    Raises the event - a TIME NEW POINT INSTANCE
    Trigger - USER object. USER_PASSWORD
    The two process - mode

    Action type - property
    Object Type - point
    Target - USER object. USER_PASSWORD
    Name of the property - ACTIVE (APPLICATIONS COVER)
    -False

    Save and open/close both forms. In the modes entry or query, whenever the user access the password field, it is disabled and cannot be changed.

    I hope that it works as expected. Just play :-)

  • Newb question - displays only the first of several fields

    As a first application of Bb, I write a stopwatch and I want the larger time scale and the small milliseconds. As part of what I am trying to display several bitmap or label side-by-side fields, but when I run it using the Simulator, only the first is displayed.

    So, for example, what I want is:

    1-2: 3 4:5:6 7 8 9

    with each number in own field but what I mean is just

    1

    that is the first field. If I then use buttons they all appear in the verticalFieldManager by default in horizontalField Manager but if I use labels or bitmaps, then all I get is the first field, even if I remove the horizontalFieldManager and just use the default verticalFieldManager. I googled the question, this forum and spent several hours reading the code examples and documentation, but I have yet to understand why I can't put several fields of these types of side-by-side. I have to have something between them as separators or empty fields?

    The code that I've got so far is the following...

     public TimerView()    {     super();      HorizontalFieldManager timerField = new HorizontalFieldManager();
    
          Bitmap hour10 = Bitmap.getBitmapResource("num_1.png");        Bitmap hour01 = Bitmap.getBitmapResource("num_2.png");        Bitmap minute10 = Bitmap.getBitmapResource("num_3.png");      Bitmap minute01 = Bitmap.getBitmapResource("num_4.png");      Bitmap second10 = Bitmap.getBitmapResource("num_5.png");      Bitmap second01 = Bitmap.getBitmapResource("num_6.png");      Bitmap ms100 = Bitmap.getBitmapResource("num_7.png");     Bitmap ms010 = Bitmap.getBitmapResource("num_8.png");     Bitmap ms001 = Bitmap.getBitmapResource("num_9.png");     Bitmap colon = Bitmap.getBitmapResource("Colon.png");
    
          BitmapField bfHour10 = new BitmapField(hour10);       BitmapField bfHour01 = new BitmapField(hour01);       BitmapField bfHourColon = new BitmapField(colon);     BitmapField bfMinute10 = new BitmapField(minute10);       BitmapField bfMinute01 = new BitmapField(minute01);       BitmapField bfMinuteColon = new BitmapField(colon);       BitmapField bfSecond10 = new BitmapField(second10);       BitmapField bfSecond01 = new BitmapField(second01);       BitmapField bfSecondColon = new BitmapField(colon);       BitmapField bfMs100 = new BitmapField(ms100);     BitmapField bfMs010 = new BitmapField(ms010);     BitmapField bfMs001 = new BitmapField(ms001);
    
          timerField.add(bfHour10);     timerField.add(bfHour01);     timerField.add(bfHourColon);      timerField.add(bfMinute10);       timerField.add(bfMinute01);       timerField.add(bfMinuteColon);        timerField.add(bfSecond10);       timerField.add(bfSecond01);       timerField.add(bfSecondColon);        timerField.add(bfMs100);      timerField.add(bfMs010);      timerField.add(bfMs001);
    
            add(timerField);  }
    

    I know that this code violates probably some best practices or standards, but I intend to clean later.

    -edited for spelling

    Give it a go with images of the numbers.  You have it easy with BitmapFields, because you know how much space they need with

    getPreferredHeight() and getBitmapWidth().  Then you should be able to stick them next to each other.

    If I was doing this and who are looking for a special look at the clock, which seems to be what you are doing, I would like to have the digital icons as you do, and then set an image large enough to hold the value of the clock and in my routine of painting, select draw digital icon proper, in the right place.  As long as you load the bitmaps only once, I think it's the most effective way to do it.

    Of course, a much simpler way would be to have just a RichTextField formatted as you suggest - RichTextField because you can have two different fonts in a single field.

  • Update several fields... need advice.

    Hi all

    I have a bit of a problem with the update of several fields in a table...

    Lets say we have two tables. Table one is called t_employe for example:
    create table t_employe (
    year number,
    line varchar2(1),
    counter number,
    value number)
    To set random data in the table:
    insert all
    into t_employe (year, line,counter, value)
    values(2011,'3','2946','3344')
    into t_employe (year, line,counter, value)
    values(2011,'3','2947','4433')
    into t_employe (year, line,counter, value)
    values(2011,'3','2948','4455')
    into t_employe (year, line,counter, value)
    values(2011,'3','2949','5544')
    select * from dual
    OK second table would be:
    create table to_update (
    year number,
    line varchar2(1),
    counter number,
    date_pos_1 date,
    value_pos_1 number,
    date_pos_2 date,
    value_pos_2 number,
    date_pos_3 date,
    value_pos_3 number,
    date_pos_4 date,
    value_pos_4 number,
    date_pos_5 date,
    value_pos_5 number)
    Data:
    insert all
    into to_update (year, line,counter, date_pos_1,value_pos_1,date_pos_2,value_pos_2,date_pos_3,value_pos_3,date_pos_4,value_pos_4,date_pos_5,value_pos_5)
    values(2011,'3','2946',sysdate,'5434',null,null,null,null,null,null,null,null)
    into to_update (year, line,counter, date_pos_1,value_pos_1,date_pos_2,value_pos_2,date_pos_3,value_pos_3,date_pos_4,value_pos_4,date_pos_5,value_pos_5)
    values(2011,'3','2947',sysdate,'11',sysdate,'123',null,null,null,null,null,null)
    into to_update (year, line,counter, date_pos_1,value_pos_1,date_pos_2,value_pos_2,date_pos_3,value_pos_3,date_pos_4,value_pos_4,date_pos_5,value_pos_5)
    values(2011,'3','2948',sysdate,'33',sysdate,'44',sysdate,'8908',null,null,null,null)
    into to_update (year, line,counter, date_pos_1,value_pos_1,date_pos_2,value_pos_2,date_pos_3,value_pos_3,date_pos_4,value_pos_4,date_pos_5,value_pos_5)
    values(2011,'3','2949',sysdate,'1',sysdate,'2',sysdate,'343',sysdate,'78',null,null)
    select * from dual
    OK, now what I want to do is to update the fields in the table to_update where value_pos is NULL. To explain this better imagine
    Collums are from left to right in the order value_pos_1, the value_pos_2, the value_pos_3... Now, I would check for each line
    If value_pos_1 is null if it is then updated. Finist this row and move them to another. If not go to value_pos_2 in
    same rank and check again if the null value. If it's updated, if not, again to go forward. Each value_pos_X cullum has a date_pos_x cullom
    to be made same day as Value_pos_ cullums (if value_pos_X is null then date_pos_X coresponding will be null as well - is)
    a fact in my table).


    So is it feasible using only a single update?

    I managed to write a select statement by using the clause of the case that makes these things perfectly only for value_pos_X fields. I wonder if I can use in my
    Update statement?
    select 
    case when a.value_pos_1 is  null then b.value else 
         case when a.value_pos_2 is  null then b.value else
              case when a.value_pos_3 is  null then b.value else
                   case when a.value_pos_4 is  null then b.value else
                        case when a.value_pos_5 is  null then b.value else to_number('99999','9999,99')
    end
    end
    end
    end
    end  as value
    
    from to_update a,t_employe b
    where a.year = b.year
    and a.line= b.line
    and a.counter = b.counter 
    Suggestions how to extract it from?

    Thank you!
    SQL> select  *
      2    from  to_update
      3  /
    
          YEAR L    COUNTER DATE_POS_ VALUE_POS_1 DATE_POS_ VALUE_POS_2 DATE_POS_ VALUE_POS_3 DATE_POS_ VALUE_POS_4 DATE_POS_ VALUE_POS_5
    ---------- - ---------- --------- ----------- --------- ----------- --------- ----------- --------- ----------- --------- -----------
          2011 3       2946 27-AUG-11        5434
          2011 3       2947 27-AUG-11          11 27-AUG-11         123
          2011 3       2948 27-AUG-11          33 27-AUG-11          44 27-AUG-11        8908
          2011 3       2949 27-AUG-11           1 27-AUG-11           2 27-AUG-11         343 27-AUG-11          78
    
    SQL> merge
      2    into to_update a
      3    using (
      4           select  a.rowid rid,
      5                   b.value
      6             from  to_update a,
      7                   t_employe b
      8             where a.year = b.year
      9               and a.line= b.line
     10               and a.counter = b.counter
     11          ) b
     12     on (
     13         a.rowid = b.rid
     14        )
     15     when matched then update set value_pos_1 = nvl2(value_pos_1,value_pos_1,b.value),
     16                                  value_pos_2 = nvl2(value_pos_1,nvl2(value_pos_2,value_pos_2,b.value),value_pos_2),
     17                                  value_pos_3 = nvl2(value_pos_1 + value_pos_2,nvl2(value_pos_3,value_pos_3,b.value),value_pos_3),
     18                                  value_pos_4 = nvl2(value_pos_1 + value_pos_2 + value_pos_3,nvl2(value_pos_4,value_pos_4,b.value),value_pos_4),
     19                                  value_pos_5 = nvl2(value_pos_1 + value_pos_2 + value_pos_3 + value_pos_4,nvl2(value_pos_5,value_pos_5,b.value),value_pos_5)
     20  /
    
    4 rows merged.
    
    SQL> select  *
      2    from  to_update
      3  /
    
          YEAR L    COUNTER DATE_POS_ VALUE_POS_1 DATE_POS_ VALUE_POS_2 DATE_POS_ VALUE_POS_3 DATE_POS_ VALUE_POS_4 DATE_POS_ VALUE_POS_5
    ---------- - ---------- --------- ----------- --------- ----------- --------- ----------- --------- ----------- --------- -----------
          2011 3       2946 27-AUG-11        5434                  3344
          2011 3       2947 27-AUG-11          11 27-AUG-11         123                  4433
          2011 3       2948 27-AUG-11          33 27-AUG-11          44 27-AUG-11        8908                  4455
          2011 3       2949 27-AUG-11           1 27-AUG-11           2 27-AUG-11         343 27-AUG-11          78                  5544
    
    SQL> 
    

    Or yhis is perhaps more readable:

    merge
      into to_update a
      using (
             select  a.rowid rid,
                     b.value
               from  to_update a,
                     t_employe b
               where a.year = b.year
                 and a.line= b.line
                 and a.counter = b.counter
            ) b
       on (
           a.rowid = b.rid
          )
       when matched then update set value_pos_1 = case when value_pos_1 is null then b.value else value_pos_1 end,
                                    value_pos_2 = case when value_pos_1 is not null and value_pos_2 is null then b.value else value_pos_2 end,
                                    value_pos_3 = case when value_pos_1 + value_pos_2 is not null and value_pos_3 is null then b.value else value_pos_3 end,
                                    value_pos_4 = case when value_pos_1 + value_pos_2 + value_pos_3 is not null and value_pos_4 is null then b.value else value_pos_4 end,
                                    value_pos_5 = case when value_pos_1 + value_pos_2 + value_pos_3 + value_pos_4 is not null and value_pos_5 is null then b.value else value_pos_5 end
    /
    

    SY.

  • Adding fields to a Manager different button clicks

    if (field == buttonField && label.equals("First")) {
                LabelField label = new LabelField("1");
            add(label);
            buttonField.setLabel("Last");}
    else if (field == buttonField && label.equals("Last")) {
            buttonField.setLabel("First");
            labelField2 = new LabelField("2");
            add(labelField2);
            labelField3 = new LabelField("3");
            add(labelField2);
    }
    

    Here is an example of my FieldChangeListener. It is clear what he does (even for me clear ). It simply adds fields - a field to the first button clicks - and two others to the second click.

    What I want to do is to add these fields to a manager - regardless of the vertical or horizontal, I just need to get the concept of how it should be done. The idea is to build a manager at the first click on a button and add labelField. When the second click occurs, I need this Manager to add an other field (s), for example as in my example code.

    Could you please indicate the way to do this? It might be very obvious of sth, yet lack me.

    EDIT: spelling errors, sorry...

    Edit2: Can it be reached via setter/getter?

    Setter / getter did the trick.

    if (field == buttonField && label.equals("First")) {
                getHFM();
                    LabelField label = new LabelField("1");
            setHFM().add(label);
            buttonField.setLabel("Last");
    }
    else if (field == buttonField && label.equals("Last")) {
            buttonField.setLabel("First");
            labelField2 = new LabelField("2");
            setHFM().add(labelField2);
            labelField3 = new LabelField("3");
            setHFM().add(labelField2);
    }
    
    public HorizontalFieldManager getHFM(){
            hfm = new HorizontalFieldManager(USE_ALL_WIDTH);
            add(hfm);
            return hfm;
    }
    public HorizontalFieldManager setHFM() {
            return hfm;
    }
    
  • Customizing fields to a manager of a screen.

    This is my first post here, so Hi everyone.

    I have the following problem:

    I create a "Manager" to the screen. So, I want to add the field to this Manager, and after that I want to add fields to this handler in sublayout method and try to setPositionChild and LayoutChild. The problem apparently is that I can't call the following functions on the newly created Manager, because they are protected.

    GRR Im may be confusing.

    Since I went through a period of similar confusion about a year ago, I think I know what you're asking.

    So here:

    1. some of these protected methods aren't for you to call - they are called by the BlackBerry infrastructure.  You override methods such as sublayout(), setPreferredWidth() etc to change the behavior of your Manager.

    2 setPositionChild() and layoutChild(), on the other hand, are protected and not private in the abstract class Manager exactly because RIM wanted to give you access to them when extending the class of their Manager.  You call to your sublayout() method to position the fields as desired.

    3. you don't add fields inside your method of sublayout() - you add before add your manager to another Manager (or a screen). When the screen containing your Manager finally gets push in the battery of the screen, the system calls your method sublayout() to determine how your manager wants to look in the provided rectangle.  In addition to laying the fields, you will need to call setExtent() and setVirtualExtent() it.  In order to browse your fields managed one by one, use getFieldCount() and then getField() in a loop.

    Good luck - you will need it!

    Arkady.

    P.S.: I suggest that you answer here again if you have more general questions.  For something more specific, try searching the forums first, and then open your own new discussion if you can't find what you need.

  • I just looked at problems with importing files from nikon D810 in LR 5.7 it pop a window saying it can't read the files to work on an imac 27 "yosemite on my mac pro running after several times he finally managed to read files and import them into LR

    I just looked at problems with importing files from nikon D810 in LR 5.7 it pop a window saying it can't read the files to work on an imac 27 "yosemite on my mac pro running after several times he finally managed to read files and import them into LR, I never had this problem before there was a sort of update that could from cause?

    What is the destination folder that the date be underneath?  In the top right it says users who suggests, you try to put the photos on top of your username instead of under your username.  Maybe that's the problem.  So change your folder in the drop-down list at the bottom right of what it should be rather than users, and if you're going to show us the destination of your photos at least scroll through the list of folders down right so that we can see which is the white highlight.

    Here is how mine looks like if I want to put my photos imported under my subfolder users - Steve - photos by date:

  • How to move the fields in the contact forms

    I'm having a devil of a time of formatting of my muse contact form.  I had "change all" checked when I click on the widget to the entire form.  First of all, when I go to one of the fields and in the name field options, I checked all the fields - required, display the quick text, etc-, but the text prompt does not appear.  In addition, because I chose to edit together does all fields ' required?  Then, the big one - I searched and seen so many tutorials on this but I have not met that tells you how to move text fields.  Phone-work is down and I wanted to move it to the top.  And then when I added a custom field I wanted to add 'Profession' and place it under 'Name' but will have a hard time with that.  Anyone out there who can help me?  Frustrated!

    Hello

    Selection in Muse form Widget works like other widgets in the program. You enter more deeply into the hierarchy every click: so with the first click you select the form, with the next click you select the form field, with the next click you select label/Input/button/SMS text according to what you click.

    You can select and move individual form fields or several fields of form (shift + click to add to the selection) wherever you want. There is a Form of Message field that isn't visible in States other than the Normal State - pay attention to move upward if you moved everything upward, but still see that your form is larger than expected with an empty space at the bottom [more often than not - the Message form field is the culprit]. Just go to any State other than Normal with the chosen form and you will see this field.

    Hope that clarifies how you can customize the form Widget in the Muse.

    Thank you

    Vikas

  • How to subtract two fields in a form?

    I am working on a form of spending and I everything works except one thing.

    Subtract all on payments reports on previous expenditures on the State of current spending. I'm looking at the tab to calculate the properties of text field.  But I don't see a way to remove my two fields.

    Then, I set up a field that contains a negative, except when I display the field in the form, the negative is positive.  I enter-1 as a default value to my field of 'subtraction '.  I was then several 1 negative against most of payment the amount so I can get a negative on the amount of the payment.  I was then going to add the negative on the amount of the payment for the total amount to pay and arrive at a net due, but it does not work.

    Here is the calculation I'm doing:

    Total spending (field calculated from all previous fields.)

    Deductible expense (entered by the user)

    NET check fresh (Total expenses - deductible).

    Can someone tell me how to proceed?

    Thank you

    Dennis

    With Acrobat, there are 3 options of calculations.

    "The field is the _____ of the following fields:" options are for the sum, product, average, min and max operations or actions that could be repeated on several fields. We do generally not subtract or divide several fields in action.

    'Simplified field notation' uses only the field names and values. The field names must begin with an alphabetic character and has no spaces or special characters. Cannot perform conditional control statements or functions. Special characters or spaces may be in domain names, if the JavaScript escape character precedes the special character or a space. 4 arithmetic operations can be performed.

    'Calculation of custom JavaScript' has no restrictions on field names, control statements, functions or mathematical operations. We have access to the field object and the value property of the field object.

  • Hide/show several fields via the Radio button

    Hi all

    I use the script below on an option button to hide and display a field on a form. I also want to use the same button to control another field named 'instructions for lbl_dynamic' The Acrobat forms book I use as a guide does not address the hiding and showing of several fields at the same time. My attempts to add the second field have failed. How can I change the script to control two fields instead of one?

    Thanks in advance for any ideas on that.

    var lst_dynamicFld = this.getField ("lst_dynamic")

    If (event.target.value == 'Yes') {}

    lst_dynamicFld.hidden = false

    }

    else {}

    lst_dynamicFld.hidden = true

    }

    'hidden' is obsolete, which means that in the next version of

    Acrobat/Reader, your script could no longer works if you use it.

Maybe you are looking for