TableLayoutManager doesn´t focus in the Manager with two focusable elements

Hello

I m using TableLayoutManager in my project. It is an example of my problem:

I have this code:

public MyScreen() {
        setTitle("TableLayoutManager_Example");

        VerticalFieldManager vfm0 = new VerticalFieldManager();
        vfm0.setBorder(BorderFactory.createSimpleBorder(new XYEdges(10, 10, 10, 10), Border.STYLE_TRANSPARENT));
        VerticalFieldManager vfm = new VerticalFieldManager();
        vfm.setBorder(BorderFactory.createRoundedBorder(new XYEdges(5, 5, 5, 5)));

        TableLayoutManager table = new TableLayoutManager(new int[] { TableLayoutManager.USE_PREFERRED_SIZE,
                TableLayoutManager.SPLIT_REMAINING_WIDTH, }, null, 0, Manager.NO_HORIZONTAL_SCROLL
                | Manager.NO_VERTICAL_SCROLL);

        LabelField lb=new LabelField("Label1    ");
        HorizontalFieldManager hfm=new HorizontalFieldManager();
        TextField tf=new TextField();
        LabelField lb2=new LabelField("Label2",Field.FOCUSABLE);
        tf.setText("Text");
        tf.setMaxSize(5);

        hfm.add(lb2);
        hfm.add(tf);

        LabelField lb3=new LabelField("Label3");
        LabelField lb4=new LabelField("Label4",Field.FOCUSABLE);

        table.add(lb);
        table.add(hfm);
        table.add(new SeparatorField());
        table.add(new SeparatorField());
        table.add(lb3);
        table.add(lb4);

        vfm.add(table);
        vfm0.add(vfm);
        add(vfm0);
}

The problem is that I have can´t emphasis in the TextField. If I just add lb and hfm components to the table, it works, but if I add other components focuss (as example) I can´t focus in the TextField, the emphasis in Label4:

What can I do?

Thank you.

I ve found a good solution. I ve replaced the TableLayoutManager navigationMovement method. This is the code:

/**
     * Navigation movement to allow for both cell to cell within a columns and row movement
     */
    protected boolean navigationMovement(int dx, int dy, int status, int time) {
        int focusIndex = getFieldWithFocusIndex();
        int dirY = (dy > 0) ? 1 : -1;
        int absY = Math.abs(dy);

        for (int y = 0; y < absY; y++) {
            focusIndex += _columns * dirY;
            if (focusIndex < 0 || focusIndex >= getFieldCount()) {
                //#ifdef BlackBerrySDK4.5.0
                this.invalidate(); //ref #217
                //#endif
                return false;
            } else {
                Field f = getField(focusIndex);
                if (f.isFocusable()) {
                    f.setFocus();
                } else
                    y--; // do it over again
            }
        }

        int dirX = (dx > 0) ? 1 : -1;
        int absX = Math.abs(dx);
        for (int x = 0; x < absX; x++) {
            focusIndex += dirX;
            if (focusIndex < 0 || focusIndex >= getFieldCount()) {
                //#ifdef BlackBerrySDK4.5.0
                this.invalidate(); //Ref #217
                //#endif
                return false;
            } else {
                Field f = getField(focusIndex);
                if (f.isFocusable()) {////////////////////////NEW CODE /////////////////////////////////////                    if(f instanceof Manager){
                        int fieldsInManager=((Manager)f).getFieldCount();
                        if(fieldsInManager>0){
                            for(int i=0;i

I'm looking for a manager within the cell. If I found it, I put emphasis in its elements. It works with a Manager with one or more of the focus object elements.

If you see it is good, you can add this code to your original code

Thank you.

Tags: BlackBerry Developers

Similar Questions

  • How to manage the structure of the event with two loops

    I have a question about the structure of the user event with 2 buttons?

    key 1: START LOGGING DATA

    key 2: STOP LOGGING DATA

    How do I control my

    structure of the event so that it will work? because now that the loop is save data... I can't stop the loop, when I clicked on buttons.

    super_saiyans wrote:

    the problem with moving it is that I don't have control of the DATA RECORD STARTING?

    Of course, you do.  When you get your press conference button, you say your state machine to move to the State of logging.  You must also make sure that you return to visit the State to wait for the event to check out the events of the stop button.

  • Lightroom and color management with two monitor profiles

    I have a problem with Lightroom CC on a computer with two monitors. The images on the calibrated Eizo different in Lightroom and Photoshop. I tried many things, but it comes down to the fact that Photoshop uses correctly the different profiels ICC for two screens, but Lightroom doesn't have. That is a known issue and there will be an update to solve?

    It's on a Macintosh computer.

    Lightroom has problems with Version 4 monitor ICC profiles. Make sure that your calibration than SW preferences are set to create ICC Version 2 profiles.

  • Using a remote control or the remote with two Apple TV app?

    1 can a remote AppleTV, is the most recent or a last generation we use with two different AppleTV (one is the most recent and is the older generation)?

    2. an iPhone Remote APP can be used with two different Apple TV?

    Thank you.

    1 not easily. There is no way to select the device to control, you end up control both. You could get a programmable remote control and lead to control different devices, but this would require a deception.

    2. no doubt. The Remote app offers a grid of all ATVS, he knows, and you choose the one to control. It has the advantage of a keyboard for searches, passwords, etc. Do you need a remote pair with each ATV.

  • Using the same value of the column with two conditions as different results

    Hi all

    Maybe it's easy to answer what I'm trying to do now, but my brain really stop and I need your opinion. I have a table of account which has values like below

    Account Fairy OBJ type of Unit year
    11500196AA130

    20

    12000196AA1302012000-196AA1302011000-196AA1302023000196AA1302024500-196AA13020

    If I can get flow and receiveable with two different query sql like underneath, but I can't get the flow and the reciveable with the sum in a row and sql. Please give me some opinions to go.

    Thank you

    SELECT

    To_char (Trim (Account)) Account_no,

    (select accountname in AddressBook where accountname addid = TO_CHAR (TRIM (account))),

    Sum(Fee/100) flow

    Of

    account tb1

    where

    obj in ('196') and tb1.type = 'AA' and TO_CHAR (TRIM (unit)) = "130".

    and year = '20'

    and tax > 0

    Group

    account

    order by

    account;

    SELECT

    To_char (Trim (Account)) Account_no,

    (select accountname in AddressBook where accountname addid = TO_CHAR (TRIM (account))),

    Sum(Fee/100) reciveable

    Of

    account tb1

    where

    obj in ('196') and tb1.type = 'AA' and TO_CHAR (TRIM (unit)) = "130".

    and year = '20'

    and tax < 0

    Group

    account

    order by

    account;

    SELECT

    Trim (Account) Account_no,

    (select accountname in AddressBook where accountname addid = TRIM (account)),

    Sum (case when fairy< 0="" then="" fee/100="" else="" 0="" end)="">

    sum (case where fees > 0 then charge/100 0 otherwise end) flow

    Of

    account tb1

    where

    obj in ('196') and tb1.type = 'AA' and TO_CHAR (TRIM (unit)) = "130".

    and year = '20'

    Group

    account

    order by

    account;

  • The most effective method to add Gaussian blur to the background of the Interview with two people

    I have MXF clips of an interview with two people with a décor of forest behind the two subjects. I want to add a Gaussian blur on the bottom between the two people who are sitting and separated by about 6 inches. I'd be able to do this now in 2014 PR, except track masks do not work as there seems to be a bug. I've never used AE and Mocha looks like a tracking method possible. The manual speaks using a compressed JPG of sequence, then use your original film when you apply the data. This sounds like the way to go, but I do not know how to apply the data originally from the film. I know how to apply a blur and a simple mask followed in AE, but it does not follow the outline of the person and blurs the second person. If followed PR mask worked, I duplicate the layer and add a mask of garbage that would cut off the other person in each of the two layers.

    I intend to learn AE, but has a deadline this week to get this infomercial delivered to the customer. Thus, detailed instructions would be greatly appreciated.

    Thank you, Rob

    According to your film, the Roto Brush tool can be a good choice to separate people from the background.

  • BlackBerry Smartphones using Desktop Manager with two BB?

    Hello

    I have a laptop of Desktop Manager 4.7 v already and a Curve 8900 and I synchronize my Outlook contacts and calendar between the laptop computer and the curve.

    I use now a separate BB storm 9500 that I also need to synchronize. Desktop Manager can manage two devices?

    Hi and welcome to the forums!

    The software uses the PIN as a unique identifier for the BB.

    So yes, you can use two. Make sure when you back up the devices you

    have a pattern of naming in place to ensure that. IPD file belongs to

    the curve and the storm. Or you can store them in different directories.

    Thank you

    Bifocals

  • How to create a button in the State with two different images?

    What I mean is... I have a picture that is conveyed as a button that has not been pressed, and I also have an image that expresses the same key but this time it is pressed. Is there a way to ensure that when the button is normal I seized the image of the button upward and then make sure that when I roll on or press the Enter key, the image of the button down?

    Thank you, Ben Charter

    Hi Ben,

    Just create a Menu and with the Normal State is selected, use the fill options to fill an image in the Menu item. Select the rollover / the mouse to the bottom of the State in the States Panel, then assign an image by using the options to fill again. This is a swap of base image using normals and States of Muse down mice.

    Kind regards

    Akshay

  • What does the icon with two arrows in a circle mean?

    Tab section has top, icons of hat, mask and two arrows.

    These are not explained in tips and tricks, which is only help I could find.

    Help please to all the features.

    Tabs

    Private - navigation tabs https://support.mozilla.org/en-US/kb/mobile-private-browsing-browse-web-without-saving-syncing-info

    Tabs synchronized - https://support.mozilla.org/en-US/kb/how-do-i-set-up-firefox-sync

  • Control the event with two controls

    Here's what I have.

    I have two separate loops of time. Inside of each timed loop, I have a structure of the event. Each structure is the trigger by pressing a button each. It works very well.

    However, I would like to add a third button that runs the two structures of the event. I want to do this without creating additional events in each structure. Is it possible to somehow this third button wire to the other two and to trigger both based on the action of the third? I have problems it works.

    Thank you

    Small example

  • Overview of the task with two monitors

    Hello, I use a dual monitor configuration. Lets take an example and say that I have two open browser windows and at least two Windows Word as well. A browser and Word Windows are open on monitor 1. and the other browser on Monitor 2. At the same time, I have visible browser windows on both screens, but I want to take a sneakpeek on a Word doc to compare some data I have on the the browser window on the screen 2. If I move the cursor of the mouse on the Word icon in the taskbar, I get previews of open task which are very nice, but as I do drag the cursor over any one of them, the browser window Monitor 2. disappears.

    In this case I can click on the word you want, comparison, and then cut again, but it's 2 clicks. It would be much faster and more ergonomic (no clicks), if I wanted to get an overview of the task for the window on the specific screen, where it is currently open, but in the meantime the window on the second monitor remains visible.
    Y at - it such an option to put in place?
    I hope that I gave a good example and was clearly. Thank you for your help.

    Hi Alex,

    I want to explain that the thing you want to get on the taskbar is not possible.  The taskbar functionality is to design that cannot be changed.

    See the link given below to better understand:

    http://Windows.Microsoft.com/en-us/Windows7/products/features/Windows-taskbar

    Thank you

  • Impossible to merge local changes using the MUD with two RPDs

    I can't find any option which indicates the local variations of merge under file-> multi-user option. I don't have that publish to the network while the ORACLE MUD tutorial says I need to merge local changes initially before publishing it on the network. For this reason if I delete a column of my SPR and publish it on the network it does not show the column removed as a conflict and it merges without comments. Please help me. I have not found a solution for this anywhere. Thanks in advance!

    Looks like you have an older version of this tutorial compared to a newer administration tool...

  • Need to query the result with two different of a same attribute values

    Hi all

    I have a search query where I need the query result when an attribute have two different values (e.g.: want the query result when the attribute 'status' is equal to 1 and 2)

    And also, the user will be able to search by any State result.

    What is the best way to implement this.

    Thank you
    DK

    The solution to this use case is to put the part by default ((statut == 1 ou statut == 2) and: bindUserInput is null) as part of the query and the Pratt of the query to run when a value is entered by the user in a view criteria. East view criteria (Status ==: bindUserInput) and the value of the checkbox to ignore the values null. If the binding variable: bindUserInput is null, only the portion of the query is running, if the binding variable is not null, the display criteria is added at the request of three and three default components will not return any line.

    Timo

  • Overlay in the Manager field

    I have a related question to display that I have not been able to answer. It relates the point c below.

    Scenario:
    Let's say I have 5 cards in hand.
    a. I want to display the cards in a row, one next to the other, BUT with the cards overlapping partially (just like how you would hold some cards in your hand while playing a game).
    b. once I posted the cards, I want to be able to move the focus from one card to the other as I scroll using the trackball
    c. when any card is the focus, I want this card to be superimposed over all cards - in other words, if this card was partially shown because he was behind another card, but, when it gets the focus, it must show itself completely before any other map so that it is completely visible.

    I was able to achieve (a) and (b) thanks to the API documentation, and thanks to what I learned from the responses on crackberry forums. To achieve (a) and (b), each of my cards is a BitmapField and I have a Manager customized to help me display and scroll cards.

    However, I am NOT able to (c) above. It seems that the Manager (net.rim.device.api.ui.Manager) displays the fields in the same order that they were added to it. So if you add Field1 to the Manager before you always add Field2, then the Manager (Yes, always) displays Field1 below or under Field2 in the event of partial overlaps between Field1 and Field2. I found that the only way to work around this problem was to 'remove' field1 of the Manager and "add" it to have it above Field2 in the display. I find this ridiculous workaround solution because intuitively adding / removing fields from a Manager and fixing these fields display problems seem irrelevant to me. So is - can anyone help with a better solution?

    Thank you!

    It's still not not clear to me what you want. Manager of application areas are drawn is in default is order of adding to the Manager with drawn up targeted field. For me, it's a quite logical. If you really need, you can change this substituting subpaint handler method and calling paintChild for children of fields in an order that you want. However I don't think that's what you want. For me, it's a lot more easy just add fields to the Manager in the order appropriate to customize the Manager to paint them in the order you want. That is to do something like this

    int [] rndm = {1,4,2,0,3};for (int i = 0; i < 5; i++){   mgr.add(new BitmapField(createImage(rndm[i]), Field.FOCUSABLE));}
    

    This way is much better, because the order of default naviagtion is also specified by field addition of order. There is no GOT behind the RIM Manager implementation that can guess the order of presentation of the user interface. Of course you can change it as well by substituting the nextFocus method, but why do you need all this in the first place? It's not clear to me this behavior you want to change in my example. What is the expected behavior? For me it all friendly a), b) and c) restrictions. I missed something?

  • Grid Control 11g of the problems with the basic policy of RAC database

    We have a group of three nodes 11 GR 2 (rac1, rac2, rac3) and a policy based RAC database 11 GR 2 (ORCL) with cardinality 2 (ORCL_1 and ORCL_2) on this group. Used to monitor the Control 11g Grid infrastructure. Founded political RAC databases are linked to the pools of the server and not to the cluster nodes, therefore, restart the cluster database instances can run on both on 3 nodes in the cluster. For example, if ORCL_1 is running ORCL_2 and rac1 rac2 Sir after a full reboot ORCL_1 and ORCL_2 can be run on rac2 and rac3 respectively. Binding of the pool with two special nodes will be as if we use database RAC database administrator and not the policy based.

    Now the problem is that Grid Control registers the services in database with the node that is running the instance due to which, once the instances are started on a different node, she complained authorities are declining. We don't have to then reconfigure database instances and say Grid Control that they are now on another node. However, this removes the history of AWR for these instances.

    Is there a solution to this problem?

    Kind regards

    Kashif.

    Hi koko,.

    to work around this problem (I think that there is no "automatic" support in the current version of EM for switching hosts databases), you can create an ACTION_SCRIPT for your database cluster resource that is running the relocate_targets command emcli (so an emcli should be placed on all nodes of your and recorded with Super Administrator privileges). So every time you start your database resource, this script command / move the target to the current host without losing any historical information.

    Best regards
    Robert

    Edit: You can find an example of the command emcli in this document written by Rob Zoeteweij: http://oemgc.files.wordpress.com/2011/02/manage-node-failover-in-an-active-passive-setup-using-oracle-enterprise-manager-grid-control1.pdf
    In this scenario is an active/passive environment, but the command itself appies to your situation, too.

    Published by: Robert Hanuschke on August 1, 2011 13:11

Maybe you are looking for