ListField focus problem.

Hi people,

I have a problem with listfield focus. in the 8900 v4.6.1, the last update does not disappear when I select a new line.

Do the invalidate in line works, but navigation has become with the slow performance.

Code:

package mypackage;

import java.io.IOException;
import java.io.InputStream;
import java.util.Hashtable;
import java.util.Vector;

import javax.microedition.lcdui.Font;

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.BitmapField;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.component.ListField;
import net.rim.device.api.ui.component.ListFieldCallback;
import net.rim.device.api.ui.decor.BackgroundFactory;

public final class HelpScreen extends CustomMainScreen {
    protected boolean onSavePrompt() {
        try {
            save();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            System.err.println("Excecao HelpScreen 1 " + e.getClass() + " - " + e.getMessage());
            e.printStackTrace();
        }
        return true;
    }

    private Vector content = null;
    private ListHelpScreen callback;

    public HelpScreen() {

        // System.out.println("HelpScreen");

        setBanner(new BitmapField(Bitmap.getBitmapResource(ScreenManager.getStringProperty("helpscreen.banner"))));
        setBackground(BackgroundFactory.createSolidBackground(0x434343));
        content = getVector();

        ListField list = initCallbackListening();

        list.setSize(content.size());
        // list.setRowHeight(62);
        int rowheight = ScreenManager.getPositionAtKey("helpscreen.listfield.rowheight");

        list.setRowHeight(rowheight);
        add(list);
        LabelField copyright = new LabelField("Cielo Mobile " + ServerRequests.version + "\n" + "© Todos os direitos reservados",
                Field.USE_ALL_WIDTH) {
            protected void paint(Graphics graphics) {
                graphics.setColor(Color.WHITE);
                super.paint(graphics);
            }

        };
        copyright.setBackground(BackgroundFactory.createSolidBackground(0x434343));
        copyright.setPadding(ScreenManager.getPositionAtKey("helpscreen.copyright.padding.top"),
                ScreenManager.getPositionAtKey("helpscreen.copyright.padding.right"),
                ScreenManager.getPositionAtKey("helpscreen.copyright.padding.bottom"),
                ScreenManager.getPositionAtKey("helpscreen.copyright.padding.left"));
        copyright.setPosition(ScreenManager.getPositionAtKey("helpscreen.copyright.position"));

        copyright.setFont(getFont().derive(Font.STYLE_PLAIN, 14));

        add(copyright);

    }

    private Vector getVector() {
        Vector menuItems = new Vector();
        Hashtable currentElement = new Hashtable();
        Class classs = null;
        try {
            classs = Class.forName(this.getClass().getName());
        } catch (ClassNotFoundException e) {
            // TODO Auto-generated catch block
            System.err.println("Excecao HelpScreen 2 " + e.getClass() + " - " + e.getMessage());
            e.printStackTrace();
        }
        InputStream stream = classs.getResourceAsStream("/fraseologia.properties");
        PropertiesUtil properties = new PropertiesUtil();
        try {
            properties.load(stream);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            System.err.println("Excecao HelpScreen 3 " + e.getClass() + " - " + e.getMessage());
            e.printStackTrace();
        }
        currentElement.put("title", "1 " + ((String) properties.getProperties().get("pergunta1")).toUpperCase());
        menuItems.addElement(currentElement);

        currentElement = new Hashtable();
        currentElement.put("title", "2 " + ((String) properties.getProperties().get("pergunta2")).toUpperCase());
        menuItems.addElement(currentElement);

        currentElement = new Hashtable();
        currentElement.put("title", "3 " + ((String) properties.getProperties().get("pergunta3")).toUpperCase());
        menuItems.addElement(currentElement);

        currentElement = new Hashtable();
        currentElement.put("title", "4 " + ((String) properties.getProperties().get("pergunta4")).toUpperCase());
        menuItems.addElement(currentElement);

        currentElement = new Hashtable();
        currentElement.put("title", "5 " + ((String) properties.getProperties().get("pergunta5")).toUpperCase());
        menuItems.addElement(currentElement);

        currentElement = new Hashtable();
        currentElement.put("title", "6 " + ((String) properties.getProperties().get("pergunta6")).toUpperCase());
        menuItems.addElement(currentElement);

        currentElement = new Hashtable();
        currentElement.put("title", "7 " + ((String) properties.getProperties().get("pergunta7")).toUpperCase());
        menuItems.addElement(currentElement);

        currentElement = new Hashtable();
        currentElement.put("title", "8 " + ((String) properties.getProperties().get("pergunta8")).toUpperCase());
        menuItems.addElement(currentElement);
        //
        // currentElement = new Hashtable();
        // currentElement.put("title", "Cielo Mobile " + ServerRequests.version);
        // currentElement.put("text", "© Todos os direitos reservados");
        // menuItems.addElement(currentElement);

        return menuItems;
    }

    private ListField initCallbackListening() {
        callback = new ListHelpScreen();
        ListField listField = new ListField() {

            protected boolean navigationClick(int status, int time) {
                // TODO melhorar essa logica
                if (this.getSelectedIndex() < 8) {
                    UiApplication.getUiApplication().pushScreen(new AnswersScreen(this.getSelectedIndex()));
                }

                return true;
            }
        };
        listField.setCallback(callback);
        listField.setFont(this.getFont().derive(Font.STYLE_PLAIN, 16));

        // listField.setRowHeight(-3);
        return listField;
    }

    private class ListHelpScreen implements ListFieldCallback {
        private int lastIndex = 0;

        public void drawListRow(ListField listField, Graphics graphics, int index, int y, int width) {

            Hashtable currentCellInformations = ((Hashtable) content.elementAt(index));

            Bitmap image = null;
            if (index == listField.getSelectedIndex()) {
                image = Bitmap.getBitmapResource(ScreenManager.getStringProperty("helpscreen.listfieldcallback.image.hint"));
            } else {
                image = Bitmap.getBitmapResource(ScreenManager.getStringProperty("helpscreen.listfieldcallback.image"));
            }

            graphics.drawBitmap(0, y, image.getWidth(), image.getHeight(), image, 0, 0);

            String text = (String) currentCellInformations.get("title");
            graphics.setColor(Color.WHITE);
            graphics.drawText(text, ScreenManager.getPositionAtKey("helpscreen.listfieldcallback.inicialoffset.x"),
                    ScreenManager.getPositionAtKey("helpscreen.listfieldcallback.inicialoffset.y") + y);
             listField.invalidate(lastIndex);
            lastIndex = index;
        }

        public Object get(ListField listField, int index) {
            return content.elementAt(index);
        }

        public int getPreferredWidth(ListField listField) {
            return ScreenManager.getPositionAtKey("helpscreen.listfieldcallback.preferredwidth");
        }

        public int indexOfList(ListField listField, String prefix, int start) {
            return content.indexOf(prefix, start);
        }
    }
}

Could you help me please with other alternatives?

Thanks in advance.

It was the solution for me

ListField listField = new ListField() {
            private int lastIndex = 0;

            public int moveFocus(int amount, int status, int time) {
                lastIndex = getSelectedIndex();
                invalidate(lastIndex);
                return super.moveFocus(amount, status, time);
            }

Thank you!!!

Tags: BlackBerry Developers

Similar Questions

  • Infinity focusing problem on my SX700

    I always infinity focusing problems with my SX700.  I have the yellow box indicating that the image will be sweet if taken.  This happens on at least 1 other point cannon and shoot that I know.  I can focus to several hundred feet but not 10 000.  Does anyone else have this problem?  I am at my end and ready to jump ship to another manufacturer if I can't get to the bottom of this.  I never had this problem with my G-10.  Could this be a problem with extreme telephoto lens Canon point and shoot models?

    I have a Canon PowerShot SX150is and a Canon PowerShot G12, and I get the same questions. Here's what I learned. The problem with any long zoom point and shoot at the tele end is the amount of contrast detection that occurs to allow the development. With shorter zooms, the atmosphere is less dense, but more zooms to detect the density of the air. This is particularly noticeable on days with higher humidity levels, but would not have noticed the days of low humidity very dry. So the blur warning you get. The camera is not getting enough contrast to narrow the focus. No matter what brand you use, if the camera uses contrast detect focus, it will be the result. Not all use contrast detect, so be sure to check before you choose "deserting a ship."

    I would keep the ISO as low as possible, and if you can manually set the focus to infinity, it should help. But this has always been a sore spot with me on cameras Canon PowerShot with how long and complex manual focus is. Hope this helps you understand what may be the problem you are experiencing.

    Steve M.

  • Focus problems

    Hello

    I spent a lot of time trying to figure out what was causing a weird problem that is a few clicks away from buttons are ignored. After doing some tests I ran into components compiled Clip. If I remove them from the library that the update works as I expect. The problem is that I don't want (and don't have the time to) create or find replacements for all of the Compiled clips I used in this project.

    Does anyone know how to overcome this problem without removing these components?

    I've created a simple example to show you guys the problem we have here.

    If you compile the code and run the application (slider.fla and problemCompiledClip.fla), then click on in the textField (to set the focus to the subject), you will see the focus remains in the textField component when you click the buttons. I don't want this behavior, I would like the update in the... invisible buttons.

    Now, if you go to the library (on problemCompiledClip.fla) and delete component ProgressBar which is not yet used, the behaviour you will get is that I want to achieve. This is the average, even if the focus is in the textField and then you click any button, the object disappears from the textField object. Who do ALL the events of clicks in the buttons of her captured.

    If I wasn't clear on the problem, let me know.

    Thank you very much
    See you soon

    the source code is here: http://www.actionscript.org/forums/showthread.php3?p=614213#post614213

    I use components if I am unable to get detailed help. but I know that this problem has been discussed in this forum and, I think, using the component development manager led to a resolution of the problem.

    Try this forum looking for something like focus problems. most of the people who encounter this problem do not realize it is a problem of component and if the components are not mentioned in their section of wire or a subtopic.

  • Custom bitmap focus problem with toolbar

    Hi all

    I'm new development of BB.

    I have screen with the title bar and after a toolbar customized

    The custom toolbar contains 3 bitmaps in the side chain and the left text right.

    Logo 'text'---> title bar

    Image1 image2, image3 "screenName"---> toolbar custom

    ListField

    Three images are created using the bitmap.

    I get the focus on the full range.

    But I want to focus on the first image, image1 when the application runs.

    If the user navigates the screen using the keyboard, change of focus to the next image, which is image2 and so on.

    How can I do that.

    I use the Blackberry API 4.2.1

    My current code for the toolbar is like that

    package com.pebbletalk.blackberry.ui;
    
    import com.pebbletalk.blackberry.defines.PTDefines;
    import com.pebbletalk.blackberry.utils.CustomFont;
    
    import net.rim.device.api.system.Bitmap;
    import net.rim.device.api.system.Display;
    import net.rim.device.api.ui.DrawStyle;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.component.BitmapField;
    
    public class ToolBar extends Field implements DrawStyle
    {
        private int fieldWidth;
        private int fieldHeight;
        private int backgroundColor;
        private String toolBarName = "";
    
        private Bitmap homeIcon = Bitmap.getBitmapResource("go-home-1_16x16.png");
        private Bitmap searchIcon = Bitmap.getBitmapResource("search-1_16x16.png");
        private Bitmap refreshIcon = Bitmap.getBitmapResource("reload-1_16x16.png");
    
        public ToolBar(String toolbarName)
        {
            super(Field.FOCUSABLE);
            fieldHeight = Display.getHeight()/10;
            fieldWidth = Display.getWidth();
    
            // Setting background color to white
            backgroundColor = Color.BLACK;
    
            toolBarName = toolbarName;
    
        }
    
        public Bitmap getHomeIcon() {
            return homeIcon;
        }
    
        public int getPreferredHeight()
        {
            return fieldHeight;
        }
    
        public int getPreferredWidth()
        {
            return fieldWidth;
        }
    
        protected void layout(int arg0, int arg1)
        {
            setExtent(getPreferredWidth(), getPreferredHeight());
        }
    
        protected void paint(Graphics graphics)
        {
            int height = this.getPreferredHeight();
            int width = this.getPreferredWidth();
    
            int left = this.getLeft();
            int top = this.getTop();
    
            graphics.setColor(backgroundColor);
            graphics.fillRect(0, 0, width, height);
    
            //graphics.drawBitmap(left, top, width, height, homeIcon, 0, 0);
            graphics.drawBitmap(left, 5, width, height, homeIcon, 0, 0);
            //int currentX = graphics.getTranslateX();
            //int currentY = graphics.getTranslateY();
            int homeIconWidth = homeIcon.getWidth() + 5;
            graphics.drawBitmap(homeIconWidth, 5, width, height, searchIcon, 0, 0);
            int searchIconWidth = homeIconWidth + searchIcon.getWidth() + 5;
            graphics.drawBitmap(searchIconWidth, 5, width, height, refreshIcon, 0, 0);
            int refreshIconWidth = searchIconWidth + refreshIcon.getWidth() + 5;
    
            CustomFont titleFont = new CustomFont(Defines.TOOLBAR_DASHBOARD_TITLE_FONT_FACE, Defines.TOOLBAR_DASHBOARD_TITLE_FONT_SIZE, Defines.TOOLBAR_DASHBOARD_TITLE_FONT_STYLE);
            graphics.setFont(titleFont.changeFont());
    
            Font currentFont = graphics.getFont();
            int textLength = currentFont.getAdvance(toolBarName, 0, toolBarName.length());
            textLength += 5;
            System.out.println("width : "+ width);
            System.out.println("refreshIconWidth : "+ refreshIconWidth);
            System.out.println("textLength : "+ textLength);
            int remainingWidth = width - refreshIconWidth;
            System.out.println("remainingWidth : "+ remainingWidth);
            int startPosition = remainingWidth - textLength;
            System.out.println("startPosition : "+ startPosition);
            int newX = refreshIconWidth + startPosition;
            System.out.println("newX : "+ newX);
            //int xPosition = width - refreshIconWidth;
            //System.out.println("tool x : "+ xPosition);
    
            graphics.setColor(PTDefines.TOOLBAR_DASHBOARD_TITLE_COLOR);
            graphics.drawText(toolBarName, newX, 5, (DrawStyle.RIGHT | DrawStyle.LEADING) );
        }
    }
    

    and my toolbarScreen code is

    MainScreen mainScreen = new MainScreen(Screen.NO_VERTICAL_SCROLL);
    
            //MainScreen mainScreen = new MainScreen();
    
            // add custom title bar
            mainScreen.add(titleBar);
    
            VerticalFieldManager verticalFieldManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR)
            {
                public void paint(Graphics graphics)
                {
                    graphics.setBackgroundColor(Color.WHITE);
                    graphics.clear();
                    super.paint(graphics);
                }
                protected void sublayout(int maxWidth, int maxHeight)
                {
                    int displayWidth = Display.getWidth();
                    int displayHeight = Display.getHeight() - titleBarHeight;
                    super.sublayout(displayWidth, displayHeight);
                    setExtent(displayWidth, displayHeight);
    
                }
            };
    
            //now add everything in the verticalManager
    
            // add custom toolbar
            mainScreen.add(toolBar);
            mainScreen.add(new SeparatorField());
    

    Please help me to solve my problem.

    Remember that the BlackBerry smartphone focuses on a field, not a picture.  Your toolbar is only a field, so one thing to focus on which is the Blackberry's.

    You have two choices:

    (a) change your toolbar to be a Manager and have several fields that it contains.  You can make a HorizontalFieldManager and assuming that the other things are set correctly (in particular the width of the fields that you add) this will do what you want.

    (b) substitute events in development movement in your toolbar to make it appear focus is moved.

    I think the second option is more difficult, especially when you start to take the touch screen into consideration.  However, with the second option, you get a much easier control over the look of your toolbar.  But I'd go with the first one, as I think it is easier for new programmers.  Initially, I wouldn't get to hung up on the appearance of the toolbar, get it works the way you want and then try to get it looking right.

  • window focus problems

    Hello fellow travelers... Since the update to 10.11.5 I have problems with windows does not come to the front when you click on to and does not come to be the focused window. No left or right mouse clicks don't work in the window. I have to close and reopen a window to make it sensitive. I also get error messages stating that the audio files cannot be changed because they are read-only. I read in the Infolog & right of authorization user and administrator. The files are on an external drive and were available in os 10.9.5. Any ideas?

    See if start-up aid.

    Stop your Mac. Start with the SHIFT key is pressed. This will start in Safe Mode, with all extensions turned off. Safe mode is slow to comlete, so give it time, he checks a lot of staff. If it works fine in Safe Mode, restart normally.

  • Astrophotography Focus problem

    Hello I have the NEX 6 (with the SALT 50 mm F1.8 lens) and most of the time to enjoy. I bought it mainly for astrophotography and need tips for image correctly targeted (during playback or downloaded on my computer). I can't seem to get a clear focus, on the LCD or electronic viewfinder, but reading and uploaded images are not as well doors. I take several images focus, but no adjustment of the scope or the camera make attention the final result. This problem is the same in all forms of astrophotography, home, eyepiece projection and imaging of the camera.

    What camera modes are best for this Live View configuration effect i.e? I tried to use peki Focus, but is not effective for these low light objects like planets. Even the Moon images suffer from the same problem.

    I tried pre-focus the camera to infinity by placing it on a tripod or grafted onto the stand using MF Assist and the scope for a 'infinite '. THA has not helped either. I tried techniques, proposed on the astro sites, such as the use of high ISO focus, wearing different glasses (and set the diopter adjustment VIEWFINDER accordingly) and reset the ISO for the shhot. none available seems to help. What suggestions do you have?

    Thanks in advance for any assistance with this problem.

    I would recommend that you enable the setting [before Shutter curtain]. This function is intended to shorten the time lag between the shutter by reducing the movement of the shutter mechanism.

    Vibration caused by the shutter must be quite negligible not because of blur your images. Please check if the images taken with the Shutter curtain before setting enabled and disabled will have any differences. If the subject (e.g. stars) move, slight blurring occurs when you use a slow shutter speed.

    If my post answered your question, please mark it as "accept as a Solution.

  • random auto focus problem Canon EF-S 18-55

    Hello

    I have worked with Canon EF-S 18-55 IS NO Lenes and have found a problem that I just can't seen to solve. The problem is I get autofocus, but at times it will not focus. I changed the card with a known good, engine Assembly, contacts with good looking for work units but not the contact Strip because they seem good.

    The Assembly moves freely with little resistance. I've also seen this problem on the IS versions too but especially on versions IS.

    I'm looking for any other suggestions that could solve the problem.

    Well I finally found out what the problem was and fixed 3 Lenes.

  • Focus problems with Rebel T3i. It will not be in manual or auto focus point. It's not about camera lens

    My camera will not focus. Not only the autofocus. I can't he focus even if I put manual focus.

    The image is still blurry.

    First I thought it was the lens I had but I tried with several, and the problem is the same.

    Any ideas what could be the problem?

    Thank you

    Have you checked the viewfinder diopter?  , It will be not clear even on the manual focus, and it happens with all your lenses makes me think that it is possible that the dial tiny bit right there on the eyepiece was implemented accidental market. The dial control what you see in the viewfinder, not something to do with the focus lens. The diopter is adjustable so that those who need glasses can see things through the viewfinder.  If everything still seems blurry even when the camera thinks he's focused it is generally just that little diopter got hit accidentally.

    IFIT is not this, then perhaps your screen focus got shifted.

  • List of the HorizontalFieldManager with scrolling focus problem

    Hello

    I'm doing a vertical list of horizontalfieldmanager with an icon and two text fields, but I'm having a problem when scrolling it. I used a nullField to manage focus. When I scroll to the top everything works well, but when I Ahmed to the bottom of the item appears on the edge of the screen.

    I guess that I did not understand how to manage the focusChange metodh and the metodh of the painting.

    All advice will be appreciated.

    Thank you, Andrea.

    //
        // Main screen for the application
        //
        private class MyMainScreen extends MainScreen
        {
            public MyMainScreen()
            {
                super(Manager.USE_ALL_WIDTH);
    
                for (int i = 0; i<20; i++) this.getMainManager().add(new PanelRow("off", "first text line", "second text line"));
            }
    
            private class PanelRow extends HorizontalFieldManager implements FocusChangeListener
            {
                private NullField nullField;
                private BitmapField icon;
                private ColorLabelField label1;
                private ColorLabelField label2;
    
                public PanelRow(String iconString, String label1String, String label2String)
                {
                    super(Manager.USE_ALL_WIDTH);
    
                    // Add null field
                    nullField = new NullField(NullField.FOCUSABLE);
                    nullField.setFocusListener(this);
                    super.add(nullField);
    
                    // Add bitmap
                    Bitmap offIcon = Bitmap.getBitmapResource("offButton.png");
                    icon = new BitmapField(offIcon, BitmapField.NON_FOCUSABLE | BitmapField.FIELD_LEFT);
                    super.add(icon);
    
                    // Add first and second text lines
                    VerticalFieldManager labelsVerticalManager = new VerticalFieldManager();
                    label1 = new ColorLabelField(label1String, LabelField.NON_FOCUSABLE | LabelField.FIELD_LEFT);
                    label2 = new ColorLabelField(label2String, LabelField.NON_FOCUSABLE | LabelField.FIELD_LEFT);
                    labelsVerticalManager.add(label1);
                    labelsVerticalManager.add(label2);
                    super.add(labelsVerticalManager);
                }
    
                public void focusChanged(Field field, int eventType)
                {
                    invalidate();
                }
    
                protected boolean navigationClick(int status, int time)
                {
                    fieldChangeNotify(FieldChangeListener.PROGRAMMATIC);
    
                    return true;
                }
    
                protected void paint(Graphics g)
                {
                    int oldBackground = g.getBackgroundColor();
    
                    if (nullField.isFocus())
                    {
                        g.setBackgroundColor(Color.CADETBLUE);
    
                        label1.setFontColor(Color.WHITE);
                        label2.setFontColor(Color.WHITE);
                    }
                    else
                    {
                        g.setBackgroundColor(Color.WHITE);
    
                        label1.setFontColor(Color.SLATEGRAY);
                        label2.setFontColor(Color.BLACK);
                    }
    
                    g.clear();
    
                    g.setBackgroundColor(oldBackground);
    
                    super.paint(g);
                }
            }
    
            //
            // Define a new colored labelfield class
            //
            public class ColorLabelField extends LabelField
            {
                public ColorLabelField(Object text, long style)
                {
                    super(text, style);
                }
    
                private int mFontColor = -1;
    
                public void setFontColor(int fontColor)
                {
                    mFontColor = fontColor;
                }
    
                protected void paint(Graphics graphics)
                {
                    if (-1 != mFontColor) graphics.setColor(mFontColor);
    
                    super.paint(graphics);
                }
            }
        }
    

    Then try to create your NullField with getFocusRect override: like this:

    nullField = new NullField(NullField.FOCUSABLE) {
      public void getFocusRect(XYRect rect) {
        getManager.getExtent(rect);
        rect.setLocation(0, 0);
      }
    };
    

    Paint won't help you - you must tell the system to the entire span developed in order to scroll properly. If the above fails, analyze your focusChanged eventType and make sure that your Manager is fully visible on the screen on FOCUS_GAINED. To do this, you need to use getManager () .getVerticalScroll () / getManager () .setVerticalScroll () as well as of your Manager and getHeight() getTop().

  • ListField setListSelection() problem of drawing

    Hi all, I'm new in the development of bb and I will try to create a ListField class to manage ListField and ListFieldCallBack design, but I have a problem with ListField SetSelectedIndex (Position), because ListFieldCallBack does not "drawListRow" (don't shoot list lines) and ListField seems to be empty, it restarts to draw only when users scroll ListField control.
    I don't really know how to resolve or work around this problem...
    I try with RIM Jde 5.0.0 and BB Storm 9550

    Application - start
    Grid VediOrdini = new Grid();
    VediOrdini.Inizialize ("Select CodCli, CodLinea, coding of AgeLinea", Gv.Db, this);
    VediOrdini.AddColumnPerc (0, "CodCli", "L", 40);
    VediOrdini.AddColumnPerc (1, "CodLinea", 30, "C");
    VediOrdini.AddColumnPerc (2, "Coding", 30, "R");
    VediOrdini.Draw ();
    VediOrdini.SetSelectedIndex (350);

    -Draw() class ListField
    MiaLista = new ListField(); Lista oggetto Dichiaro
    MiaLista.setRowHeight (RowHeight); Transamissões is delle lines
    MiaCallBack = new TestListCallback(); Reminder it derivo by manage the list
    MiaLista.setCallback (MiaCallBack); E lo transamissões sulla mia lista
    RowSelected = - 1; Inizializzo he number di riga per poterlo manage poi selezionata e tornare in caso di GetSelectedIdex
    Line r;
    int i = 0;
    {while (DataReader.Next ())}
    r = DataReader.getRow (); Ciclo he mio "DataReader".
    MiaLista.insert (i); Will di volta in volta una riga alla lista
    By mi ogni Riga del datareader i campi della riga in one Salvo ' oggetto line
    Lines MiaRiga = New Rows (Colonna.size (), r);
    Riga.addElement (MiaRiga);

    i ++ ;
    }
    MyVFieldManager VFieldManager = new MyVFieldManager (Manager.VERTICAL_SCROLL, ListWidth, ListHeight);
    VFieldManager.add (MiaLista); Gli bell'attacco E degli articles list
    SC. Add (VFieldManager); Lo will went form

    -SetSelectedIndex (Posizione) class ListField
    MiaLista.setFocus ();
    MiaLista.setSelectedIndex (Posizione);
    Manager manager = MiaLista.getManager ();
    manager.setVerticalScroll (Posizione * RowHeight);
    MiaLista.invalidateRange (Posizione, (Posizione + RowPage));

    Can someone help me please?
    Thanks in advance

    I've seen problems such as too, where the setSelectedIndex must run on the event Thread.

    The best thing to do is some code to be run in this way and use "invokeLater" package.  I actually do sometimes even when I'm on the edge of events, because I want to change to take place later.

    Then put the setSelectedIndex and everything you think you need to do, in one of them:

    UiApplication.getUiApplication () .invokeLater (new Runnable() {}

    public void run() {}

    here

    {

    {);

  • Field Focusable problem

    Hi all

    In my program, there is 1 HorizontalFieldManager and 2 AbsoluteFieldManager

    Now, I add 2 AFM of HFM and it looks like this

    __ ___ __ ___ __ __

    |    AFB1 |    AFM2 |

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

    the problem is when I add a buttonField, ButtonField.Focusable in AFM2

    When the application is run, the starting point should not be the AFB1 but it's my buttonField

    I think that happens because of the buttonfield Focusable

    If anyone knows how to fix this help please me, all I want is to ensure that the application starting point will be to first vfm.

    Thank you

    on the screen display, the first Focus field gets focus.
    There are no fields in AFB1, how to get the focus?

    You can put a nullfield in this, or any other field focusable.

  • Setting the focus problem - stadium is null?

    I'm trying to programmatically set the development of a textinput, however the debugger throws me this error:

    Cannot access a property or method of a null object reference.

    I'm trying to set the focus with this line

    stage.focus = input
    

    For reference, here's a bit of the code

    package views
    {
        import flash.display.GradientType;
        import flash.display.Graphics;
        import flash.display.Shape;
        import flash.events.MouseEvent;
        import flash.events.TouchEvent;
        import flash.geom.Matrix;
        import flash.text.TextFormat;
        import flash.text.TextFormatAlign;
    
        import qnx.input.IMFConnection;
        import qnx.ui.buttons.LabelButton;
        import qnx.ui.core.UIComponent;
        import qnx.ui.display.Image;
        import qnx.ui.text.Label;
        import qnx.ui.text.TextInput;
    
        public class RenamePopupContainer extends UIComponent
        {
            private var input:TextInput;
            private var file:String;
    
            public function RenamePopupContainer(_file:String)
            {
                super();
                file = _file;
                setSize(1024, 600);
                setPosition(0, 0);
                createChildren();
    
                IMFConnection.imfConnection.showInput();
                stage.focus = input;
            }
    
            private function createChildren():void
            {
                var labelFormat:TextFormat = new TextFormat();
                labelFormat.color = 0xFFFFFF;
                labelFormat.size = 28;
                labelFormat.align = TextFormatAlign.CENTER;
    
                var mat:Matrix = new Matrix();
                mat.createGradientBox(400, 1);
    
                var line1:Shape = new Shape();
                line1.x = 312;
                line1.y = 92;
                line1.graphics.beginGradientFill(GradientType.LINEAR, [0xeeeeee, 0xeeeeee, 0xeeeeee], [0, 1, 0], [0, 127, 255], mat);
                line1.graphics.drawRect(0, 0, 400, 1);
                line1.graphics.endFill();
                addChild(line1);
    
                var label:Label = new Label();
                label.text = "Rename to?";
                label.setSize(450, 40);
                label.setPosition(287, 43);
                label.format = labelFormat;
                addChild(label);
    
                input = new TextInput();
                input.setSize(380, 40);
                input.setPosition(322, 120);
                input.text = file;
                addChild(input);
    
                var line2:Shape = new Shape();
                line2.x = 312;
                line2.y = 190;
                line2.graphics.beginGradientFill(GradientType.LINEAR, [0xeeeeee, 0xeeeeee, 0xeeeeee], [0, 1, 0], [0, 127, 255], mat);
                line2.graphics.drawRect(0, 0, 400, 1);
                line2.graphics.endFill();
                addChild(line2);
    
                var btnOk:LabelButton = new LabelButton();
                btnOk.setSize(120, 40);
                btnOk.setPosition(384, 210);
                btnOk.label = "Ok";
                btnOk.addEventListener(MouseEvent.CLICK, ok);
                addChild(btnOk);
    
                var btnCancel:LabelButton = new LabelButton();
                btnCancel.setSize(120, 40);
                btnCancel.setPosition(519, 210);
                btnCancel.label = "Cancel";
                btnCancel.addEventListener(MouseEvent.CLICK, cancel);
                addChild(btnCancel);
            }
        }
    }
    

    This is a fairly common problem: placement of a DisplayObject property has the value NULL until it has been added to the display list.  There are a few solutions, but the easiest for you would be, if this object never will be added to the display list once.

    // in place of your existing stage.focus line
    addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
    
    ...
    
    private function onAddedToStage(e:Event):void {
        removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
        stage.focus = input;
    }
    
  • Window focus problem

    Windows will be intermittent, for a period of approximately thirty seconds to several minutes, behave strangely.  It will be defocus on the current window.  I am able to change the focus to the window using alt - tab (it seems that all the keyboard commands operate normally for the duration of this issue.  If I then try and click on the window, I changed focus to the click will cause the window to lose focus.  No windows respond to the mouse clicks for the duration of this issue (including the Task Manager).  However, windows normally meet to keyboard entries.   Sometimes explorer.exe will not respond to mouse clicks and I'm unable to open the start menu by clicking on it, other times I'm able to open the start menu and focusing on a window in the taskbar but if I then try to click on the window it will immediately defocus.  The number ends with a sharp decline in the activity of the CPU (as seen in the Manager of tasks) and everything goes back to normal behavior.  I have encountered the problem when using a wide variety of input devices, and I think that the problem is not related to the material.  This issue has made some very difficult to use programs and has been very frustrating.  I hope that the information I have provided will help you diagnose my problem.

    Thank you.

    Hello Elon,

    Thanks for the reply.

    I suggest you to check the question in the new user account.
    Reference:
    Create a user account
    http://Windows.Microsoft.com/en-us/Windows/create-user-account

    If the problem persists not in the new user account and then copy the data from the old user account again.
    To do this, refer to this article:

    Difficulty of a corrupted user profile
    http://Windows.Microsoft.com/en-us/Windows/fix-corrupted-user-profile

    I hope this information helps.

    Thank you

  • ListField Focus element

    Hey guys,.

    I was wondering if it is normal for a ListField. When I add the listfield to my default screen always stresses the first item in the list (index 0). It makes blue (which is the selected default color), but the problem is in my application the actual Center is not yet in the field of the list. I don't want my listfield to highlight the first item in the list that there is actual discussion on the list... there at - it a way to stop this behavior occur? or maybe a way to setSelectedIndex None?

    Any help would be greatly appreciated

    Thank you

    I managed to do stop doing... I just used

    If (pGraphics.isDrawingStyleSet (Graphics.DRAWSTYLE_FOCUS))

    instead of getSelectedIndex == index.

    Thanks for the help guys

  • In the view tab focus problem.

    Hello friends,

    I tried the sample screen tab. I got it at the following link (credit goes to original encoder).

    http://supportforums.BlackBerry.com/rim/attachments/rim/java_dev@tkb/175/3/TabControl.Java

    I made a few changes in the code so that the area of the lower screen is displayed when you click the respective tabs.

    When I click on the first tab, it displays the screen for the first tab, in the same way when I click on the second tab, it shows the screen for the second tab like this. BUYMD the problem that I face is... When I click on the first tab it shows the screen on the first tab. When I scroll to the screen area (which is another vertical field Manager) and still try to go to the higher HorizontahlFieldManager, the focus goes to the last tab (even if the first tab is selected.

    I want the focus to go directly to the selected tab.

    How can I achieve this?

    Thank you

    You will need to remember where emphasis was put before his departure from the Manager tab and go back when the manager gets the focus again. Make it implement FocusChangeListener and listen to its own changes of focus. On FOCUS_GAINED, check if the registered lastFocused field is not null; If this is not setFocus (wrap in invokeLater), otherwise register the domain that currently has the focus. On FOCUS_CHANGED, simply register the domain that currently has the focus. You have nothing to do on FOCUS_LOST.

Maybe you are looking for

  • Problems with the Windows Activation on the satellite A110-252

    Hello Ive recently bought a Toshiba Equium A110-252 without recovery disks. I tried to install with a Windows XP Home OEM edition discs but after installtion that he used to connect on windows without be activated everything first. I tried activating

  • Windows desktop 8: Crash when connection

    I enter the details (none), click Connect and it crashes every time. I tried everything, my windows is a clean install. Relocation, changing the settings, tried the proxy. Oh btw, I tried the Skype find in the store, that worked, but since it's so bo

  • HP probook 6570b unknow devices

    Hello, I have 2 unknown devices which I can't find the drivers. I try google it but no use :/ Maybe someone could help me with this. 1) location: PCI bus 0, device 20, function 0 Hardware ID: PCI\VEN_8086 & DEV_1E31 & SUBSYS_17AB103C & REV_04PCI\VEN_

  • 15 - j104el - envy that I found an empty bay... mSATA?

    Hello I'm new to the forum.

  • Problem in parsing Json

    I have a problem with parsing Json. While participating in the 1st time I would log on to the Console as "Jsonva length 21".JSON length 0 " After 2 or 3 attempts, I would log in the form "Jsonva length 21".JSON length 14 " Here I use to code analysis