onFocusNotify and ObjectChoiceField together

Hey guys,.

So I have this screen which built the window. On the inside of the window, I have a few ObjectChoiceFields. They work perfectly when I don't have the onFocusNotify method in the screen. When I add in there, though, the ObjectChoiceField will keep selection itself. What I mean by that: when you click on it and it goes down, then you make a selection, it will treat your selection as if you selected and immediately pressed downward again. Its kind of a simple mistake, but it can be annoying for users to have to uncheck the box every time.

I tried to build the ObjectChoiceFields in several ways. Here are two ways I tried to do, but they do not work:

Case 1

SerializableAttribute public class extends FieldChangeListener implements screen StatusWindow
{

public StatusWindow (LoginSaver l, boolean b)
{

.. lots of code

StatusWindow final self = this;

wherechoices = new ObjectChoiceField ("where", wherelist, 0, Field.FIELD_LEFT)

{
protected void fieldChangeNotify (int context)
{
System.out.println ("when you press on");
If (getSelectedIndex() > 0)
{
where.setText (((String) (getChoice (getSelectedIndex ()));
self.updateLabels ();
}
setSelectedIndex (0);
}
};

more things

}

protected void onFocusNotify (boolean focus)
{
If (focus)
{
System.out.println ("returned the setting to the point, but recently refreshed already");
}
on the other
{
System.out.println ("Lost focus");
}
}

}

Case 2

SerializableAttribute public class extends FieldChangeListener implements screen StatusWindow
{

public StatusWindow (LoginSaver l, boolean b)
{

.. lots of code

StatusWindow final self = this;

whateverchoices = new ObjectChoiceField ("Whatever", whateverlist, 0, Field.FIELD_LEFT);

whateverchoices.setFocusListener (this);

//....

}

' Public Sub fieldChanged (field field, int context)
{

If (field.equals (whateverchoices)

{
If (whateverchoices.getSelectedIndex () > 0)
{
whatever.setText (((String) (whateverchoices.getChoice (whateverchoices.getSelectedIndex ()));
updateLabels();
}
whateverchoices.setSelectedIndex (0);

}

}

protected void onFocusNotify (boolean focus)
{
If (focus)
{
System.out.println ("returned the setting to the point, but recently refreshed already");
}
on the other
{
System.out.println ("Lost focus");
}
}

}

I tried to crush the onFocusNotify for the ObjectChoiceField, but that didn't work. I tried focusRemove(), setVisualState (int visual) with nothing doesn't.

A knowledge solution or at least a hack for the not automatically reselect the ObjectChoiceField again? Thank you guys.

What model of Smartphone BlackBerry and the BlackBerry terminal software version you test on?  You can find this under Options, all on the BlackBerry Smartphone.  What happens if you call super.onFocusNotify in your onFocusNotify method?

Tags: BlackBerry Developers

Similar Questions

  • Using iPhoto and Photos together

    Is - this here anyway to use iPhoto and pictures together until I have get used to the interface of Photos?

    The Photos and both iPhoto 9.6.1 work on El Capitan.  You can have both applications open at the same time.

    Only two applications have a different format for libraries of photos, so each of them uses a separate photo library.  If you edit photos in iPhoto, the changes will not appear in the photo library and vice versa.

    You could use iPhoto and its library as your main library and import new photos in iPhoto, while exploring the Photos.  Once you are confident that the Photos will suffice your needs, open the iPhoto library in Photos and create a new library of pictures of him.  Then start to use the Photos as your main photo application.

  • View the folders and files together in alphabetical order rather than the records first, then files

    It seems impossible to display files and folders together in alphabetical order.  Instead I see files first and then the files that I often (not always) want

    I have sometimes seen them together but have no idea how this happens.

    Ferrière

    Hello Ferds,

    In Windows Explorer, simply type an asterisk in the search engine to return all the files and folders in the folder parent.  You can click on any column heading to sort the results in this column.

    Mr. Doug in New Jersey

    It is a good workaround (thanks Mr Wizard) If you want to view the files in this way - but the procedure does not correct how Explorer files are sorted in the records themselves. And you will have to do it every time you viewed a folder because the search procedure would not automatically from window to window transfer and may not be assigned to do.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Photoshop AND Bridge together?

    Hello world

    I need to Photoshop AND Bridge, only.

    I can't find information to rent the two programs together.

    It is automatically included with photoshop?

    If not how can I rent Photoshop AND Bridge together?

    Thanks for your response guys

    See you soon,.

    REMIC

    Not to worry; Bridge comes with Photoshop.

  • Is it possible to use the GESTURE and TOUCH_POINT together?

    Hello!

    I wonder if there is a way to use the GESTURE and TOUCH_POINT together in a flash mobile app (Android).

    I want a specific graphic object to respond to the TOUCH_POINT (i.e.: type on and drag) and specific gestures (i.e.: two fingers to Zoom).

    but notice that each one requires a different configuration to the global variable Multitouch.inputMode setting:

    TOUCH_TAP faucet requires:

    Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;

    where GESTURE_ZOOM requires:

    Multitouch.inputMode = MultitouchInputMode.GESTURE;

    I know it's possible in mobile applications, for example see GoogleMaps.

    But I wonder is it possible using Flash and Adobe Air...

    Thank you

    Koby

    I found a solution!

    Instead of TOUCH_TAP use MouseEvent.CLICK and then you can use the GESTURE to the Multitouch.inputMode.

    p.s.: For the long pressure feature: instead of TouchEvent.TOUCH_BEGIN use MouseEvent.MOUSE_DOWN

    and instead of TouchEvent.TOUCH_END / TouchEvent.TOUCH_OUT / TouchEvent.TOUCH_ROLL_OUT use MouseEvent.MOUSE_UP)

    For all those who may need this...

    Koby

  • Drive HARD 1 and 2 together or independent on Qosmio?

    What are the advantages and disadvantages on disk 1 & 2 Raid options used together like hard disks or raid option to two independent hard drives?

    Kind regards...

    Hello

    you have 3 possibilities: two normal hard drives, RAID 0, RAID-1

    RAID 0 (Striping): two hard disks are used as a big drive, if a HARD disk fails all data is lost

    RAID-1 (Mirroring): hard drives contain the same data if a disk fails, data is not lost

    Good bye

  • Connection of the loudspeakers and headphones together on Qosmio G30

    My question is, if it is possible to use two different audio out on Qosmio G30. It has two connectors, but seems to be linked together. I want to use my Qosmio with virtual DJ, one audio channel speakers and one for the preparation of music (for headphones). I want to have music on the speakers and headphones to better mix.

    Is this possible, or should I buy an external sound card? Is it inside the map two-channel audio or not?
    Thank you

    Hello

    I'm sure that something like this is not possible. On two ports, you will have the sound of some. Music production you can not choose which port should be used for his outgoing.

  • Characters.Escape and ObjectChoiceField

    Hi all

    I made an app that has an ObjectChoiceField and when you select an index, she throws you to another screen filtering what you see according to the selected index.

    When you are in the new screen and the user, press the ESC key to go back, the ObjectChoiceField displays the index that the user has selected before, and I want the ObjectChoiceField to set the default index value, is it possible?

    Not convinced this Sad_Bird idea is very "as object".  I don't think you want 2 screen to worry about screen 1.

    A number of options come to mind, the manifesto being once you got the selected index and screen 2, then in Screen1, just created all the index selected in your ObjectChoiceField to 0.  You can do so after you press display 2.

  • problem with my screen and ObjectChoiceField, help!

    Hi, I have a screen where there are two objectChoiceField. I want to make is that, according to the value that we chose in the first objectChoiceField, the second objectChoiceField also selectable values change. I tried in the trackwheelclick, change the first objectChoiceField, repaint the screen with the choice in this election and that option objectChoiceField the second change, but I don't not do, what am I doing wrong? Thanks in advance and sorry for my English, this is my code:

    public class MovimientoInvScreen extends MainScreen{
    
        private InformesController controller;
    
        private HorizontalFieldManager containerHoriz;
    
        private RoundRectContainer containerDatosEco;
        private RoundRectContainer containerDatosRRHH;
        private RoundRectContainer containerInfoAmpli;
    
        private GridFieldManager containerGridEco;
        private GridFieldManager containerGridRRHH;
        private GridFieldManager containerGridInfoAmpli;
    
        private ButtonField buttonMover;
    
        private BasicEditField codigo;
        private ObjectChoiceField boxProv;
        private ObjectChoiceField boxCentro;
    
        private CentroDTO centro;
        private KeyValue provincia;
        private Vector centros;
        private KeyValue provinciaActual;
    
        public MovimientoInvScreen(InformesController controller) throws Exception{
    
            this.controller = controller;
            controller.obtenerDetallesCentro();
    
            centro = controller.getCentroSeleccionado();
    
            provincia = controller.getProvinciaSeleccionada();
    
            setTitle("Mov. inventario " + centro.getNombre());
    
            containerHoriz = new HorizontalFieldManager();
    
            String choiceProv[] = {"Almería", "Cádiz", "Córdoba", "Granada", "Huelva", "Jaen", "Málaga", "Sevilla"};
            boxProv = new ObjectChoiceField ("Provincia",choiceProv, provincia.getDescripcion());
    
            centros = controller.obtenerCentrosProvincia(provincia.getId());
            Object choiceCentro[] = new Object [centros.size()];
    
            for (int i=0; i< centros.size(); i++){
                choiceCentro[i] = centros.elementAt(i);
            }
    
            boxCentro = new ObjectChoiceField ("Centro de destino", choiceCentro);
    
            codigo = new BasicEditField("Activo                                      ",
                    "", 10,    BasicEditField.FILTER_NUMERIC | Field.FOCUSABLE);
    
            buttonMover = new ButtonField("Mover", Field.FIELD_HCENTER);
    
            add(boxProv);
            add(boxCentro);
            add(codigo);
    //        add(buttonCamara);
            add(buttonMover);
        }
    
        protected void makeMenu(Menu menu, int instance) {
    
            super.makeMenu(menu, instance);
        }
    
        protected boolean trackwheelClick(int status, int time) {
    
            try{
    
                if(boxProv.isDirty()){
    
                    provinciaActual = ((KeyValue) boxProv.getChoice(boxProv.getSelectedIndex()));
                    if (provincia != provinciaActual){
    
                        boxProv.setDirty(false);
                        this.controller.setProvinciaSeleccionada(provinciaActual);
    
                        UiApplication.getUiApplication().popScreen(MovimientoInvScreen.this);
                        UiApplication.getUiApplication().pushScreen(new MovimientoInvScreen(this.controller));
                    }
    
            }catch(Exception e){
                Dialog.inform(e.getMessage());
            }
            return super.trackwheelClick(status, time);
        }
    
        public boolean onClose() {
            int i = Dialog.ask(Dialog.D_YES_NO, "¿Desea cerrar la aplicación?");
            if (i == Dialog.YES)
                System.exit(0);
    
            return true;
        }
    
        protected boolean keyChar(char key, int arg1, int arg2) {
            if(key == Characters.ESCAPE){
                UiApplication.getUiApplication().popScreen(MovimientoInvScreen.this);
                return true;
            }else
                return super.keyChar(key, arg1, arg2);
        }
    }
    

    I think that the example code provided by Dmitry is more complex that it must be to demonstrate this link.  I hope that the following code is easier to understand.

    import net.rim.device.api.i18n.*;
    import net.rim.device.api.system.*;
    import net.rim.device.api.ui.*;
    import net.rim.device.api.ui.component.*;
    import net.rim.device.api.ui.container.*;
    
    public class ObjectChoiceFieldTestScreen extends MainScreen
                                             implements FieldChangeListener {
    
        static String [] COUNTRIES = new String [] { "England", "US", "Canade" };
        static String [] ENGLAND_CITIES = new String [] { "London", "Liverpool" };
        static String [] US_CITIES = new String [] { "New York", "Washington", "Boston", "San Francisco" };
        static String [] CANADA_CITIES = new String [] { "Montreal", "Toronto", "Vancouver" };
        ObjectChoiceField _countryChoice = new ObjectChoiceField("Select Country:", COUNTRIES);
        ObjectChoiceField _cityChoice = new ObjectChoiceField("Select City:", null);
    
        public ObjectChoiceFieldTestScreen() {
            super();
            this.setTitle("Test ObjectChoiceField Linking");
            this.add(_countryChoice);;
            _countryChoice.setSelectedIndex(1);
            fieldChanged(_countryChoice, 0); // This just simulates the first 'setting' of the choice
            _countryChoice.setChangeListener(this);
            this.add(_cityChoice);
    
        }
    
        public void fieldChanged(Field f, int context) {
            if ( f != _countryChoice ) {
                return;
            }
            int countryIndex = _countryChoice.getSelectedIndex();
            if ( countryIndex == 0 ) {
                _cityChoice.setChoices(ENGLAND_CITIES);
            } else
            if ( countryIndex == 1 ) {
                _cityChoice.setChoices(US_CITIES);
            } else {
                _cityChoice.setChoices(CANADA_CITIES);
            }
        }
    }
    

    This illustrates the connection but hides a problem.  Changing the initial index of 1 (US) to 0 (England) and see what happens to the width of the field of cities.  There is a way around that.  But let's get the first sorted sequence.

  • Execution of ESXi 4.1 and 5 together

    I was looking to upgrade ESXi 4.1 at 5, but I have a 3 years old host is NOT on the compatibility list.  It is recommended to upgrade the other two and we let a crowd 4.1 or should I just wait until next May when I update?  I am that one to always upgrade when it becomes available and has been tested but it is the first time I fell on a server not on the HCL.  Your comments and suggestions are welcome.  Thank you!

    Hello

    It seems that Esxi5 and ESXi4.1 can operate together in a cluster, AFAIK vCenter will reinstall aam agent to new agents on ESXi4.1 fdm - should be OK
    http://www.VMware.com/products/vSphere/upgrade-Center/upgrade.html

    I am one to always upgrade when it becomes available and has been tested

    I'm usually waiting for U1 for each new version prior to implementation in a production

    You will really benefit after upgrade from 4.1 to 5? http://www.VMware.com/support/vsphere5/doc/vSphere-ESX-vCenter-Server-50-new-features.html

    Have you calculated the number of licese against the new licensing model that has been present in vSphere5?

  • How to move the ball and chain together?

    I created a bunch of balloons 3D and applied the preset wiggle individually to each ball. The strings are also different with each of the others that I have related to the respective ball but cannot work out how to apply for balloon wiggle and channel "move together". At the point where the ball moves in a direction and strings in another even if they have the same settings.

    Could someone please advise how to do the ball and chain squirm together?

    Thanks in advance

    Tutorial a zillion years here on the kite. It might as well be a balloon. I don't know why the QT link is broken, but this is a update of project CS5.5 folder for you to watch.

    Here's the movie:

  • CheckBox and Textfiled together

    Hello


    Apex Version 3.2

    I have a requirement where point chechbox and point textfield appears together.

    [] Checkbox1 TextField1
    [] Checkbox2 no text here field
    [] Checkbox3 no text here field
    [Checkbox4 TextField4 ]

    Box is created using lov named the query for which is'
    Select display_name , return_value from table'
    I have a very complex shape, where we checkbox and combination of textfield/select list for 9 different element. What would be the best way to do this so that when I send the page and there is a validation error so data are not erased.

    Thanks a lot for the suggestions and help.
    Shijesh

    Hi Shijesh,

    On this page, I have three regions-

    All the data - it is a main area and just is the Submit button
    Given test - this is the Parent to all data area and contains checkboxes
    Test data 2 - this is the Parent to all data area and holds the text elements

    This puts the two regions to Test side by side data

    For the region of Test data, I have the following settings:

    Attributes of the region: style = "float: left;"
    Header of the region:

    <style type="text/css">
    #P312_CHECKBOX {line-height:29px; margin-top:-4px;}
    #P312_CHECKBOX INPUT {vertical-align:middle;}
    </style>
    

    The first adjustment positions the region on the left, and the second parameter styles the height of boxes that will contain the region. What is necessary to align the boxes with text boxes. The box is a page element called P312_CHECKBOX

    Test Data 2 area has the following parameters:

    Attributes of the region: style = "float: left;"
    Header of the region:

    <style type="text/css">
    ##REGION_ID# TD {height:27px}
    ##REGION_ID#.t12Header {height:25px}
    </style>
    

    The first parameter allows the region to sit to the right of the first region

    The second parameter styles cells in the table to define the heights. My example uses 12 theme, so that your second line it may be different

    As part of header HTML of the page, I have:

    <script type="text/javascript">
    function hideShow()
    {
     $(":checkbox").each(function()
     {
      if ($(this).attr("checked"))
      {
       $("#P312_DEPT" + $(this).val()).css("display", "block");
      }
      else
      {
       $("#P312_DEPT" + $(this).val()).css("display", "none");
      }
     });
    }
    </script>
    

    This is javascript code that will allow to show or hide the text boxes.

    In the execution of the page when loading Configuration page, I have:

    hideShow()
    $("#P312_CHECKBOX INPUT").click(function()
    {
     hideShow();
    });
    

    It runs the code when the page loads and adds a function onclick for each item in the box.

    The element checkbox, P312_CHECKBOX, has the following parameter:

    Form the Option element attributes: onclick = "javascript:hideShow();" »

    This is necessary because the default in the Apex to use these attributes for the labels of a checkbox rather than the box itself - run it when loading page adds the function onclick directly on the objects checkbox, so that the user can click to

    To use unlabeled text boxes. There are no special text elements parameters except that they must be named correctly. Javascript code takes the value of the checkbox clicked and which adds to the P312_DEPT to achieve the text to show/hide element. For example, if the value of DEPTNO is 10 for a checkbox is clicked, the corresponding text element must be P312_DEPT10.

    You will need to play with the style if your page/topic is different. The feature should be allowed to use as long as you name things properly. If you have text elements that should not appear on a page, add a condition him as appropriate, but you must ensure that the order of the text items matches the order of the boxes.

    Andy

  • What is the stylish Extensions code to put lines of text and closer together paragraphs?

    If for some reason you want to change the spacing of text or to say to change the spacing between the text and a picture, how do I go to this topic?

    What is the exact code that is used?

    Try:

    P { margin-top:0px !important; margin-bottom:0px !important; }
  • I accidentally entered username and password together. now firefox 5 suggests their time revealing password to another user. How to clear?

    The box that opens automatically suggesting the user name for a site as the first letter of my e-mail address is typed reveals my password for the site.

    You can select an entry from the drop-down list and press SHIFT + DELETE to remove it.

  • G62-340US: the best RAM and SSD together for an older G62?

    I want to improve my old and slow HP G62 with a new SSD and RAM and I have a few questions.

    First of all, I found two very similar RAM packs on Amazon and I don't know what is the difference or one that will work with my laptop?

    http://www.Amazon.com/crucial-PC3-8500-204-pin-CT2K4G3S1067M-CT2C4G3S1067M/DP/B008LTBJFM?ie=UTF8&key...

    http://www.Amazon.com/GP/product/B005LDLVAO/ref=cm_cd_asin_lnk

    Second, it is possible to install an SSD in the computer? And if that's the case, what is the recommended product?

    Thirdly, if I replace my hard drive with an SSD, should I buy another copy of the operating system or is at - it a way to save that?

    You want the package of upper memory which is the right speed and density of your laptop. The other memory is more recent and probably not compatible. The top of the page says memory is for a Mac that is not in itself a problem, but you may want to consider the memory recommended by HP:

    4 GB (for models 1.1 and 1.2 only) 599092-001

    http://www.Amazon.com/HP-VH641AT-4-GB-DDR3-PC3-10600/DP/B0030L3B8E/ref=sr_1_1?ie=UTF8&QID=1459805725&SR=8-1&keywords=599092-001

    Absolutely, you can install an SSD on the laptop. Assuming that your 10 Windows is activated you can do a full system image bootable Windows 10 or you can install clean media media creation tool again and the activation of just MS servers identify your computer and you will be activated again even if you change the hard drive.

    Let us know if you need help most.

    If it's 'the Answer' please click on 'Accept as SOlution' to help others find it.

Maybe you are looking for