Selection of LabelField

OK, im having a little difficulty implementing an idea and tried to teach me, but after a few hours I think im going to ask for help. Laughing out loud.

I am wanting a series of LabelFields once selected screen and 'Enter' or trackball is pressed, taking me in a new window. So basically, it would look like this:

___________________________

-Associate label

-The two link label

-Connect the three labels

-Bind four Label

___________________________

I know this has something to do with KeyPadListener and pushScreen() but anyway I tried to write has resulted in an error. Quite simply, I don't know how to write such keypadlistener when the button ' link a Label ' is focuesed and enter or click on the trackball it gives pushScreen (blah).

I was a noob right and read every post on the unique on KeyPadListener and also past forum to review the Java library.

1. ensure that all labels are created by using LabelField.FOCUSABLE

Something like.

LabelField label1 = new LabelField("Label 1 Text", LabelField.FOCUSABLE);

2. your screen should substitute navigationalClick or navigationalUnclick (up to you depending on you want to invoke on down/up event).

Something like...

        protected boolean navigationUnclick(int status, int time)        {            Field field = getLeafFieldWithFocus();            if ( field == label1 )            {                System.out.println("Label 1 clicked!");                return true;             }            else if ( field == label2 )            {                System.out.println("Label 2 clicked");                return true;             }            return super.navigationalUnclick(status, time);         }

Note:

4.7.0 uses touch screen that uses a different API. touchEvent() of your interest

older devices that uses the wheel event IE replace trackWheelClick (State of the int, int time)

Hope that helps.

Tags: BlackBerry Developers

Similar Questions

  • Detection of selection of model AdvancedUI

    Hello

    I changed the UIExampleListStyleButtonFieldScreen of the AdvancedUI code sample class.  I have problems performing actions based on the users choice.  I see that 'field' is equal to the appropriate label, but I can't seem to get the right URL or take other actions based on selection.  I am trying to create an if statement in public Sub fieldchanged to determine who has been selected.  Something to point me in the right direction would be much appreciated:

    SerializableAttribute public class UIExampleListStyleButtonFieldScreen extends UIExampleScreen implements FieldChangeListener
    {
    Private UIExampleScreen _explanation;

    public UIExampleListStyleButtonFieldScreen() {}

    Super (NO_VERTICAL_SCROLL |) USE_ALL_HEIGHT);

    setTitle ("TU Mobile");

    Accent circumflex bitmap = Bitmap.getBitmapResource ("chevron_right_black_15x22.png");

    ListStyleButtonField a = new ListStyleButtonField ('News', circumflex accent);
    one.setChangeListener (this);
    Add (a);

    Two ListStyleButtonField = new ListStyleButtonField ('Events', circumflex accent);
    two.setChangeListener (this);
    Add (two);

    Three ListStyleButtonField = new ListStyleButtonField ('Admissions', circumflex accent);
    three.setChangeListener (this);
    Add (three);

    Four ListStyleButtonField = new ListStyleButtonField ('Track and field', circumflex accent);
    four.setChangeListener (this);
    Add (four);

    Five ListStyleButtonField = new ListStyleButtonField ('Donner de TU', circumflex accent);
    five.setChangeListener (this);
    Add (5);

    ListStyleButtonField 6 = new ListStyleButtonField ('Répertoire', circumflex accent);
    six.setChangeListener (this);
    Add (or six);

    Seven ListStyleButtonField = new ListStyleButtonField ('Photos', circumflex accent);
    seven.setChangeListener (this);
    Add (seven);

    Eight ListStyleButtonField = new ListStyleButtonField ('Map of the Campus', circumflex accent);
    eight.setChangeListener (this);
    Add (eight);

    Nine ListStyleButtonField = new ListStyleButtonField ('Weather', circumflex accent);
    nine.setChangeListener (this);
    Add (new);

    Ten ListStyleButtonField = new ListStyleButtonField ('About', circumflex accent);
    ten.setChangeListener (this);
    Add (RTE);

    _explanation = new UIExampleScreen();
    _explanation. SetTitle ("selection");

    LabelField explanationLabel = new LabelField ("detail screen");
    explanationLabel.setPadding (5, 5, 5, 5);
    _explanation. Add (explanationLabel);

    }

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

    If statement would go here?

    UiApplication.getUiApplication () .pushScreen (_explanation);
    Dialog.Alert ("FIELD:" + field);
    }

    }

    The usual practice, when you try to use the fieldChanged method as you do here, is to have the fields as "global" features to your entire class.

    So, rather than create, and not being able to reference them in your constructor, you define them in the class itself.

    Here's a quick example:

    SerializableAttribute public class UIExampleListStyleButtonFieldScreen extends UIExampleScreen implements FieldChangeListener
    {
    Private UIExampleScreen _explanation;

    Accent circumflex bitmap = Bitmap.getBitmapResource ("chevron_right_black_15x22.png");

    ListStyleButtonField a = new ListStyleButtonField ('News', circumflex accent);

    Two ListStyleButtonField = new ListStyleButtonField ('Events', circumflex accent);

    public UIExampleListStyleButtonFieldScreen() {}

    Super (NO_VERTICAL_SCROLL |) USE_ALL_HEIGHT);

    one.setChangeListener (this);
    Add (a);

    two.setChangeListener (this);
    Add (two);

    ...

    }

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

    If (field == a) {}

    ...

    }
    UiApplication.getUiApplication () .pushScreen (_explanation);
    Dialog.Alert ("FIELD:" + field);
    }

    }

  • Unable to convert the dataprovider object to VO

    What are the conditions to be able to ride like this:

    < s:DropDownList prompt = "Select user" labelField = "name" id = "users" width = "240" skinClass = "nikos.skins.comboBoxDropDown_Long_blueGrad" >
    < s:change >
    <! [CDATA]
    appUserChanged.dispatch (users.selectedItem as model.vo.User);
    []] >
    < / s:change >

    < / s:DropDownList >

    the fields in objects in the dataprovider corresponding with the user, but I still get null after melting.

    package model.vo
    {

    [Bindable]
    public class User
    {
    public var SAMAccountName:String;
    public var name: String;
    public var email: String;
    public var commentsView:Boolean;
    public var commentsUsersSelect:Boolean;
    public var ratingsView:Boolean;
    public var dateCreated:Boolean;

    }
    }

    Thank you

    I do not believe you can cast that way, but you could get round this way:

    appUserChanged.dispatch (new model.vo.User (users.selectedItem.SAMAccountName, param2, etc...));

    and add a constructor to the User class:

    public void user (SAMAccountName:String, etc...)

    {

    This. SAMAccountName = SAMAccountName;

    etc...

    }

  • How to select and change the LabelFields / ButtonFields table 2D

    Hi everyone, I'm new here and I'm new to the blackberry development.

    For a project student I'm working, I have a table 2D-ButtonFields, (I can change LabelFields if it's easier) which I use to create a Sudoku grid.

    I understand that this is really basic but I want the user to simply scroll the table 2D to a particular cell, and be able to type in a number on the keyboard instantly change the label of the ButtonField or LabelField, IE their assumption of Sudoku.

    I have really problems that I'm not familiar with how blackberry accepts user input and how it can be used with the setText method.

    So, essentially, I would like some sort of way to determine the currently selected cell (without is activated) and then for this selected cell so that the setText() method applied

    Can someone help me? I can post a code if it helps but I'm not sure it will as you al will understand how basic it is.

    Thank you in advance and I hope I can return the favor as soon as

    You can use a focuschangelistener to be aware of policy changes. or call the getLeafFieldWithFocus() to retrieve the current field.

    You can't make buttonfields editable, but you can read user input and treat it.

    for sudoku you need only numbers, you can use the keyChar method to read the characters.

    Check if your target field is one of your buttons. Check to see if the tank is entered or Louis tank (Keypad.getAltedChar) is a number (Characters.isDigit).

    You can call setText on of the buttonfield.

  • How to avoid the blue color of a LabelField default selection?

    Hello

    Below, I have given my code please review and let me know where I did wrong. because my requirment must show the labelfield with a specific color. not work but useless default blue color is coming with the text. I want to avoid that the color blue.

    final String dimensionally = 'Test ';
    LabelField lbl = new LabelField (slable, 0, slable.length (), LabelField.FOCUSABLE |) LabelField.HIGHLIGHT_FOCUS) {}
                            
    Do police = Font.getDefault (.derive(Font.UNDERLINED |)) Font.PLAIN, 12);
    int x = font.getAdvance (slable);
    int y = font.getHeight ();
    Boolean hasFocus;
    protected void paint (Graphics g) {}
    g.setColor (Color.BLUE);
    g.setFont (do);
    {if (HasFocus)}
    g.setColor (Utility.ACTIS_MAAROON_COLOR);
    g.fillRoundRect (0, 0, x, y, 10, 10);
    g.setColor (Color.WHITE);
    g.drawText (dimensionally, 0, 0);
    } else {}
    g.setColor (Color.BLUE);
    g.drawText (dimensionally, 0, 0);
    }
    Invalidate();
    Super.Paint (g);
    }
                           
    protected boolean trackwheelClick (int arg0, int arg1) {}
    //

    }

    protected void onFocus (int arg0) {}
    hasFocus = true;
    super.onFocus (arg0);
    }

    protected void onUnfocus() {}
    hasFocus = false;
    super.onUnfocus ();
    }

    public void select (boolean arg0) throws IllegalStateException {}
    Super.Select (false);
    }
    /*
    Protected Sub layout (int width, int height) {}
    width = x;
    height = y;
    Super.Layout (width, height);
    super.setExtent (width, height);
    }
    */
                           
    };

    and one last thing is that when I method of positioning cover font size is bigger.

    Please answer...

    drawHighlightRegion is used to paint the selection, see also drawFocus.

  • Help LabelField

    How to make a labelfield only select this text in brief (as rectangular selction blue) with the red color of the selected text?

    Thanks in advance

    Then, you will need to substitute drawFocus do nothing:

    protected void drawFocus(Graphics g, boolean on) {
    }
    
  • Align ButtonField Center in HorizontalFieldManger when ObjectChoceField is not selected

    Hello
    I have developed a screen in which there's a topic labelField below that there is an ObjectChoiceField... My position and ObjectChoiceField do not scroll and will remain constant, under the title and ChoiceField object I have some data that must be the subject of a scroll and I could achieve this scrolling thing but my problem is that I place a button below these materials and placed this button in HorizontalFieldManager as follows

    ButtonField back;
    HorizontalFieldManager But_Back = new HorizontalFieldManager (HorizontalFieldManager.FIELD_HCENTER);
    Back = new CustomButtonField ("Back", ButtonField.FIELD_HCENTER);
    Back.setChangeListener (this);
    But_Back.Add (back);

    The first problem: At when only the header of the loading of the page and object coice field and my left side coded hard LabelField will be present and the button below and when I select the value in the ObjectChoiceField then the values corresponding to the labelField letside will be displayed all I can attchieve using the fieldChanged but my button that is currently I am unable to put in the Center... that when the page is loaded without values are present, so the button is to the left side and when I select a value of ObjectChoiceField, then it is aligned to the Center, I want to be at the Center...
    FYI: in the order of scroll implememtn in my Constructori say

    Super (new VerticalFieldManager (), NO_VERTICAL_SCROLL);
    Here I put the code for coice position and object fields in two different HorizontalFieldManager and then announces to the screen
                 
    For the scrolling now, I create a verticalFieldManger like:
    VerticalFieldManager vor = new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL |) VerticalFieldManager.VERTICAL_SCROLLBAR);
    and each variable left and right in addition to HorozontalFieldmanger
    HFM HorizontalFieldManager = new HorizontalFieldManager();
    VFM. Add (HFM);

    and at the end I say
    HorizontalFieldManager But_Back = new HorizontalFieldManager (HorizontalFieldManager.FIELD_HCENTER);
    Back = new CustomButtonField ("Back", ButtonField.FIELD_HCENTER);
    Back.setChangeListener (this);
    But_Back.Add (back);
    VFM. Add (But_Back);
    Add (VFM);

    Add Field.USE_ALL_WIDTH in your VerticalFieldManager and DrawStyle.HCENTER in your ButtonField.

    Something like:

    VerticalFieldManager vfm = new VerticalFieldManager(Field.USE_ALL_WIDTH | VerticalFieldManager.VERTICAL_SCROLL | VerticalFieldManager.VERTICAL_SCROLLBAR);
    ///
    ///
    HorizontalFieldManager But_Back = new HorizontalFieldManager(HorizontalFieldManager.FIELD_HCENTER);
    ButtonField  Back = new ButtonField("Back",DrawStyle.HCENTER);
    Back.setChangeListener(this);
    But_Back.add(Back);
    vfm.add(But_Back);
    add(vfm);
    

    Concerning

    Bika

  • Problem with the dialog box displayed when the RadioButton is selected.

    It is an application with 3 buttons button1, radio 2 and output key that uses System.exit (0)
    The problem is with the dialogs first two buttons

    1. I open the application

    2 Select a radiobutton, I get a dialog box, I click 'ok', dialog will, that's fine.

    3. I choose an another radiobutton button1 or button2, I get the corresponding dialog, BUT know I have to click 'ok' twice to keep it alive.

    I don't know what could be the problem, here is the code:

    package com.thinkingblackberry;
    import net.rim.device.api.system.Display;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.DrawStyle;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.component.PasswordEditField;
    import net.rim.device.api.ui.component.RadioButtonField;
    import net.rim.device.api.ui.component.RadioButtonGroup;
    import net.rim.device.api.ui.component.RichTextField;
    import net.rim.device.api.ui.component.Status;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    import net.rim.device.api.ui.component.PasswordEditField;
    
    public class HelloWorldScreen1 extends MainScreen implements FieldChangeListener, DrawStyle {
    
        protected static final int RED = 0;
        MButtons fullscreen;
        //protected RadioButtonGroup rbGroup= new RadioButtonGroup();
        public HelloWorldScreen1() {
    
            final RadioButtonGroup rbGroup=new RadioButtonGroup();
    
            setTitle("Application");
    
            RadioButtonField rbField= new RadioButtonField("RadioB1"){
    
                protected void paint(Graphics g){
                    g.setColor(Color.ROSYBROWN);
                    super.paint(g);
                }
            };
            RadioButtonField rbField2= new RadioButtonField("RadioB2"){
                protected void paint(Graphics g){
                    g.setColor(Color.SIENNA);
                    super.paint(g);
                }
            };
            RadioButtonField rbExit=new RadioButtonField("Exit"){
                protected void paint(Graphics g){
                    g.setColor(Color.DARKSLATEBLUE);
                    super.paint(g);
                }
            };;
            rbGroup.add(rbField);
            rbGroup.add(rbField2);
            rbGroup.add(rbExit);
            add(rbField);
            add(rbField2);
            add(rbExit);
    
            rbGroup.setChangeListener(new FieldChangeListener() {
                public void fieldChanged(Field field, int context) {
                if (rbGroup.getSelectedIndex() == 0) {
                    Dialog.inform( ""+rbGroup.getSelectedIndex());
    
                }
                else if (rbGroup.getSelectedIndex() == 1) {
                    Dialog.inform( ""+rbGroup.getSelectedIndex());
                }
                else if(rbGroup.getSelectedIndex()==2){
    
                    System.exit(0);
                }
    
                }
            });
    
        }
    
        public HelloWorldScreen1(long arg0) {
            super(arg0);
        }
    
        public void fieldChanged(Field field, int context) {
    
        }
    
    }
    

    I guess the event changed field is called twice, once deselection button1 and once to select button2. you pay your processing logic to account for this.

  • Click Navigation LabelField problem

    Hello

    in my application if I click a bitmap field I shows a popup screen with labelfields dynamic

    If this label field, click on I want to show the selected text in a text field to another screen

    Below the code I use in the pop up screen to create the label field

    at the moment I get a last element only if I select all...

    can someone tell me where to change to get the text of the selected item

        Vector v=new Vector();
                    v.addElement("515");
                    v.addElement("516");
                    v.addElement("517");
                    v.addElement("518");
                    v.addElement("519");
                    v.addElement("520");
    
                    for(int i=0;i			 

    Standard java error it.

    I think, but haven't tested that the evolution of this

    Create.table.setText (lbl.getText ());

    TO

    Create.table.setText (this.getText ());

    the problem will be solved.

  • With the help of a list drop-down selection

    Hello world

    I scoured the web but couldn't find an answer that can help (I'm probably looking in the wrong places )

    I have a dropdown menu, with several options, I want it so that when the user selects one of them, I am able to move them to the correct screen. The problem is that I can get the index, they take and convert it into an object, but I can't understand how to check that this object matches a given string. My code is below:

    String [] BWChoices =
    {'Sit up', 'Crunch', 'Theatre', 'Pull-up', 'Down', 'Board', ' Leg Raise '};
    Creating object to body weight weight choice
    ObjectChoiceField BWList = new ObjectChoiceField ("body weight:", BWChoices, iSetTo);
    BWList.setFont (MyFont);
    _FMMain.Add (BWList);
    int index = BWList.getSelectedIndex ();
    Activity of object = BWList.getChoice (index);
    activity.toString ();
    If (activity.equals ("Crunch"));
    {
    LabelField evidence = new LabelField ("Proof");
    _FMMain.Add (Proof);
    }

    The evidence label is just here to try to prove when it works, but it always shows :/

    I have being debugged when I get it activity is equal to something else, but it still shows the label.

    Just tried before he can actually go to a new screen with:

    UiApplication.getUiApplication () .pushScreen (new YourScreen ());

    still no luck...

    Any ideas? Also is the best way to do it

    Really enjoy and help and thanks in advance

    Sorry I don't think we have enough here to really fix your code, so let go us with a little theory, since it seems not t be a confusion.

    You did this:

    Go.setChangeListener (goListener);

    When the Go field changes, the listener will be called.  In your case, the field going is a ButtonField, so that the listener is called when a user presses the button.

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

    will be called.  The context, you can ignore for now, but you wil notice that there is a defined in the JavaDoc, and allows you to distinguish the user changes, you do.  Not really applicable for a button, but for other fields, very useful.

    When fieldChanged (field, the field passed in will be the area that has changed, so in your case will be the way of the ButtonField.  You can see, in this case, it is probably unnecessary.

    You have this:

    If {(BWList instanceof field)

    that seems redundant - what else is he going to be?  What is the purpose of this statement?

    Similarly, since you know these to be defined in this way, you could probably simplify the following for instructions

    int index = BWList.getSelectedIndex ();
    the final activity String = (String) BWList.getChoice (index);

    and I'm not sure of the try/catch, but I guess it does no harm.

    You say

    "But he always, never moves it just did nothing (which seems off so he wants but it is at the moment).

    Sorry I don't understand this.  Under what circumstances you won't move?  How this is reflected in the code?

    I hope this helps.

  • Selection question tab

    I created three buttonfields like this.

    final CreateCustomField field1 = new CreateCustomField ("First tab", ButtonField.FOCUSABLE |) ButtonField.CONSUME_CLICK);
    "final CreateCustomField field2 = new CreateCustomField second tab", ButtonField.FOCUSABLE | ButtonField.CONSUME_CLICK);
    "final CreateCustomField field3 = new CreateCustomField third tab", ButtonField.FOCUSABLE | ButtonField.CONSUME_CLICK);

    I add this in to the HorizontalFieldManager like that.

    HFM HorizontalFieldManager = new HorizontalFieldManager(Manager.USE_ALL_WIDTH|NO_HORIZONTAL_SCROLL);
    HFM. Add (field1);
    HFM. Add (Field2);
    HFM. Add (field3);

    It is added to the main screen like that.

    Display display = new MainScreen();

    mainScreen.add (hfm);

    Now, three tabs (buttons) horizontal at the top of the main screen.

    Now, I'm clicking on a tab, and the corresponding content must be loaded under the tabs.

    I do like it.

    HFM HorizontalFieldManager = new HorizontalFieldManager (Manager.USE_ALL_WIDTH |) Manager.NO_HORIZONTAL_SCROLL);
    HFM. Add (new CreateCustomField ("First tab", ButtonField.FOCUSABLE |)) ButtonField.CONSUME_CLICK));
    HFM. Add ("new CreateCustomField of tab", ButtonField.FOCUSABLE |) ButtonField.CONSUME_CLICK));
    HFM. Add ("new CreateCustomField third tab", ButtonField.FOCUSABLE |) ButtonField.CONSUME_CLICK));

    mainScreen.add (hfm);   Top tabs added to the screen
    VFM VerticalFieldManager = new VerticalFieldManager();
    VFM. Add (new LabelField ("is to test the rendering of dynamic content"));   This is to add the content when you click on the tab.                mainScreen.add (vfm);  Content added to screen

    pushScreen (mainScreen);

    The questions is when clicking on the tab, the content is load and the selected tab is not selected.

    Hope the above information helps.

    Thanks in advance

    Bala.

    Certainly not need a FocusListener I think... But the setFocus() should be submitted... Let me give you an example... When an action takes place, you can focus on a hfm... Therefore, the button will implement a setChangeListener, and in your fieldChanged(), shoud encode you the setFocus...

    Hope this makes sense...

    See you soon...

  • Using DrawTextParam in a LabelField

    The problem I have is that I need an ellipsis at the beginning of the text.

    I have a method that creates a LabelField, it displays a path to a file. The file must have the end of the file visible.

    That's why I need ellipsis at the beginning so that the user can see the end of the path. I looked around and came across DrawTextParam. One of the fields is exactly what I need (TRUNCATE_WITH_ELLIPSIS_AT_START) but I can't find any style/method that accepts it.

    Is there a way I can use it on a field? Perferably LabelField but if something else accept it so I can change my code.

    Scratch what I just said. I did not read the documentation on this topic. If you use the SELECTION with TRUNCATE_BEGINNING field it truncates the text and add the points of suspension at the front of the text. Thanks Rajat_10Sep.

  • LabelField click navigation

    Hello world:

    I am trying to create a dynamic menu helps in my application.  What I'd really like is some type of display HTML in my application, but appears not to be possible without writing a rendering HTML class.  So instead, what I'm doing is adding a series of RichTextFields and ImageFields my help screen.  The problem that I am running is that I would have a set of LabelFields at the top, such that a user can click on one of them, for example help overview, and it allows to scroll the page to the desired label.

    Is there an easy way to do this in the RIM API?

    Thank you

    ~ Scott

    By defalut LabelField winn, not be seen of all the update, you have to explicitly set its Focus and LabelField ahev for you thought writing the navigationClick and according to the selection logic you could set the Focus to another LabelField. This should not be a problem.

    Apart from this, you can also consider labuching to the browser to display your HTML and also BrowserField that renders HTML code in your application. You could give a demo borwsefield looka t comes with JDE.

  • Scrolling AND selecting items in a ListField on the storm?

    Background information:

    BlackBerry Storm 9500

    BlackBerry JDE 4.7.0

    Problem:

    I use a ListField to display several items in a list. I also use the touchEvent (TouchEvent message) method to listen to a click (TouchEvent.CLICK). Well, everything seems to work except when I need to scroll through the list. It seems that using the touchEvent method, I can't scroll through the list. If I remove the touchEvent method, scrolling works but I am unable to use the touch interface to select an item in the list by clicking on it.

    Question:

    Is it possible to get both? In other words, can enable scrolling in the ListField AND allow the user to select an item by clicking on it?

    Code:

    private class SlideList extends screen

    {

    Fields

    private ListField _list;

    Private _callback ListCallback;

    Constructor

    public SlideList()

    {

    Super();

    Add a title screen

    LabelField title = new LabelField (getTitle (), LabelField.ELLIPSIS |) LabelField.USE_ALL_WIDTH);

    setTitle (title);

    setupList();

    }

    Private Sub setupList()

    {

    If (_list! = null)

    Delete (_list);

    Get all the slides and put their titles and subtitles in a table

    String [] slideTitles = getSlideTitles();

    _list = new ListField();

    _callback = new ListCallback();

    _list.setCallback (_callback);

    Build the list of exercise.

    for (int index = 0; index)

    {

    _list. Insert (index);

    _callback. Insert (slideTitles [index], index);

    }

    _list.setSelectedIndex (currentSlideNum);

    Add (_list);

    }

    Get the touch input.

    protected boolean touchEvent (TouchEvent message)

    {

    If (message.getEvent () is TouchEvent.CLICK)

    {

    Check if a list item is selected.

    If (_list.getSelectedIndex () > - 1).

    {

    Dialog.Alert ("you selected:" + _list.getSelectedIndex ());

    itemSelected (_list.getSelectedIndex ());

    Returns true;

    }

    on the other

    Returns false;

    }

    on the other

    Returns false;

    }

    Private Sub itemSelected (int listIndex)

    {

    currentSlideNum = listIndex;

    displaySlide();

    UiApplication.getUiApplication () .popScreen (this);     Remove this screen to display the program.

    }

    private class ListCallback implements {ListFieldCallback}

    private vector listElements = new Vector();

    ' public void drawListRow (list ListField, Graphics g, int index, int y, int w)

    {

    String text = (String) listElements.elementAt (index);

    g.drawText (text, slideIcons [index] .getWidth () + 10, y, 0, w);

    }

    public Object get (ListField list, int index) {}

    Return listElements.elementAt (index);

    }

    public int indexOfList (String p, ListField list, int s) {}

    Return listElements.getSelectedIndex ();

    Return listElements.indexOf (p, s);

    }

    public int getPreferredWidth (ListField list) {}

    Display sr = UiApplication.getUiApplication () .getActiveScreen ();

    Return sr.getWidth ();

    }

    public final void insert (String toInsert, int index) {}

    listElements.insertElementAt (toInsert, index);

    }

    {} public void erase()

    listElements.removeAllElements ();

    }

    }

    }

    Mark,

    Thanks for your reply. It turns out that the solution I was looking for was very simple. Rather than return

    fake

    in the touchEvent method, I back

    super.touchEvent (message)

    While touchEvent can call its parent class and always look for other events inherent in a listenField, such as scrolling with a finger.

    It now looks like this:

    Get the touch input.

    protected boolean touchEvent (TouchEvent message)

    {

    If (message.getEvent () is TouchEvent.CLICK)

    {

    Check if a list item is selected.

    If (_list.getSelectedIndex () > - 1).

    {

    Dialog.Alert ("you selected:" + _list.getSelectedIndex ());

    itemSelected (_list.getSelectedIndex ());

    Returns true;

    }

    }

    Return super.touchEvent (message);

    }

  • Select the point in combobox/drop-down list, fields to update

    Hello

    I have a drop-down list. When a user makes a selection, I would like to query a database and return the results to be displayed in a form. Note, I don't want users to have to press a button, it should happen when an element is pressed. It sounds simple enough, but because I'm new, I'm fighting.

    I understand that I need to create a 'change' and then Manager in this handler, I need to run my t service get the data, but then when I try to access these data, nothing happens. I have to Bind something to the combobox? Here is my code.

    "" < s:ComboBox id = "lcidComboBox"change = "lcidComboBox_changeHandler (event)" labelField = "name" selectedItem ="bills.locn{}'> "

    " < s:AsyncListView list =" getLocationsResult.lastResult{}"/ > "

    < / s:ComboBox >

    protected function lcidComboBox_changeHandler(event:IndexChangeEvent):void

    {

    getLocationsResult.token = locationService.getLocations ();

    trace (locations.snam); <-this is not anything!

    }

    See you soon,.

    Brian

    OK, think about it. I needed to include a tag Binding then call my answering machine, the object is able to be called and I can view its properties.

    protected function lcidComboBox_changeHandler(event:IndexChangeEvent):void

    {

    getLocationsResult.token = locationService.getLocations ();

    snamTextInput.text = locations.snam;

    cuidTextInput.text = locations.cuid;

    }

Maybe you are looking for

  • Trying to iCloud iPhone backup 6 + and tried to 'Cancel backup' now the wheels are turning and the screen is frozen. How can I stop?

    Looking for a backup initiated from my iPhone 6 s +.  Needed to leave before it's over, so I typed "cancel backup' which doesn't seem to work.  Six hours later the wheels always turn around. Message on the screen said "Turning on Backup" - it turns a

  • HP 14-r046tu: r046tu USB port drivers.

    I downgrade my windows 8 for windows 7. But when it's done its USB port do not work. I think that the drivers is missing. But why? Please help me I need USB drivers for my laptop. Thank you.

  • SkyTel.exe

    Anyone know what's Skytel .exe? Could someone please tell me (in ordinary maintenance) how do you showed on my Dell Vista Home Premium 64 bit computer and is it necessary for my system? I would also like to be sure it is real and do not know or somet

  • Java updates

    I have a HP Windows Vista and the latest update of Java that I had on 12, 2012. It was for Java 6 Update 33. A series of automatic update but I went and did a manual update and it would give me no more updates for Java 6. He said that a new version o

  • her silence suddenly

    I have the Tablet from Lenovo X 201 with intel I7 and windows 7 and 4 GB Ram, I have the sound problem my sound card is smart HD Conexant audio, 20585 the problem is all of a sudden the sound is disappear, but when I went to its volume, I found the g