How to detect when the selected item ObjectListField changed?

I expanded the ObjectListField to implement a scroller of marquee style iPod for long lines of text that will disappear from the screen. So far, I have everything works well, and it works as I expect... when it fires.

I'm having a problem to find a way to make reliable activate. It doesn't seem to be any method I can substitute or any earpiece I can use that fires when the current list item is changed. I first tried setSelectedIndex substitution. That worked sometimes, because apparently the OS is not call setSelectedIndex when he wants to change the item selected, it does something else.

Then I tried the substitution of navigationMovement and manually call the code to start the timer, but that no longer works (I was the substitution of method navigationMovement of the ListField, maybe I should have done the Manager instead?). But anyway this approach does work for the version of the storm of my application because the storm never calls navigationMovement.

Then I tried to use a fieldChangeListener, but apparently who don't get fired for the selection.

Finally in despiration I tried substitution of drawListRow, only qualifying when index equals the selectedRow. But my code of scroll calls invalidate, so of course it just causes a loop infinite drawListRow, slow down the device and not even starting the scroll, because whenever the timer is started, it cancels the old one.

Anyone have any ideas on what I can do here? Thank you.

Good end I could not fieldChangeNotify to the fire, no matter which I overrided, even with the first setting the listener. It only seems fair to shoot during the selection change event. One thing to note, I use an objectlistfield, not an ObjectChoiceField... maybe you are thinking as well to another area?

Thanks for the help anyway, in the end I was able to get the desired effect by modifying the code slightly to reuse the same animation timer rather than create a new one when the selected item changes. The timer is started in the constructor of the ListField. Works very well.

Tags: BlackBerry Developers

Similar Questions

  • How to detect when the user clicked 2 video clips?

    Hello:

    I would like to know how can I detect when 2 video clips were clicked (order irregardles).

    What I have is this:

    In my main script, I have 2 independent clips (mc_him and mc_her) each in its own layer which, when clicked, playing an internal animation without moving my head of main reading anywhere. What I do is, once both a click (like I said, it doesen't matter in what order), a button that sends me into another section of my film should appear. He really doesen't matter if the button activated with alpha or sending me to a specific framework where all my button. What I detect is two clicks for the button.

    How can I achieve this?

    Thank you very much.

    {btn1.onRelease = Function ()}

    No matter what

    This.Clicked = true;

    checkBothClickedF();

    }

    {btn2.onRelease = Function ()}

    No matter what

    This.Clicked = true;

    checkBothClickedF();

    }

    function checkBothClickedF (): Void {}

    {if (btn1. Clicked & btn2. Clicked)}

    do something. the two clicked

    reset the two clicked on properties?

    }

    }

  • ComboBox - trying to set the selected item

    I call a remote object that calls the following function to the suite. The returned object is used to fill a form of TextInputs and a ComboBox control - this is a form of change. How can I set the selected item in the ComboBox? I could not get the selectedItem to work, and I do not know the value of the index that corresponds to selectedCompany.CompanyType in order to use selectedIndex.

    private void receiveSelectedCompany(event:ResultEvent):void {}
    selectedCompany = event.result as business;

    copy the record in the areas of publishing
    txtCompanyId.text = selectedCompany.CompanyID.toString ();
    cboCompanyTypeEdit.selectedItem.CompanyType = selectedCompany.CompanyType;
    txtCompanyName.text = selectedCompany.CompanyName;
    txtCompanyShortName.text = selectedCompany.CompanyShortName;
    txtTaxId.text = selectedCompany.TaxID;
    }

    Thanks in advance,
    France

    FranceC, here is a function allows you to do.

    simply call the selectComboValue function and pass it the name of the combobox and the search string as follows:

    selectComboValue (Mazonedelistederoulante, dataObj.fieldName.toUpperCase ());

    Here's the function:

    public void selectComboValue(select:_mx.controls.ComboBox,_optionToSelect:String):void {}
    for (var i: int = 0; i< select.dataprovider.length="" ;="" i++)="">
    If (select.dataProvider.getItemAt ( ) .label == optionToSelect) {}
    select.selectedIndex = i;
    break;
    }
    }
    }

    PS: If you are looking for the data rather than on the label simply change this line:
    If (select.dataProvider.getItemAt (
    ) .label ==)
    to do this:
    If (select.dataProvider.getItemAt ( ) .data == )

  • If I have the two LOV in the same table then how to connect when I select first and second LOV value also change?

    Mr President

    If I have the two LOV in the same table then how to connect when I select first and second LOV value also change?

    My two fields are FLOW AND DR_NAME

    FLOW = ACCT_ID

    DR_NAME = ACCT_NAME

    I created with success of LOV for these fields.

    First LOV gives acct_id in the debit field and second LOV gives the value of acct_name to dr_name.

    How can I report these lov, it's that when I change my acct_id then acct_name also change

    I have these two tables

    CREATE TABLE "NOM"  (
      "ACCT_ID" VARCHAR2(7) NOT NULL ENABLE, 
      "ACCT_NAME" VARCHAR2(50) NOT NULL ENABLE, 
      "O_BAL" NUMBER(13,2),
      CONSTRAINT NOM_PK PRIMARY KEY ("ACCT_ID")ENABLE
       
       );
    CREATE TABLE "VOUCHERDET" (
      "V_ID" VARCHAR2(9) NOT NULL ENABLE,
      "LINEITEM" NUMBER ,
      "DEBIT" VARCHAR2(7) , 
      "DR_NAME" VARCHAR2(50), 
      "CREDIT" VARCHAR2(7) , 
      "CR_NAME" VARCHAR2(50), 
      "PARTICULARS" VARCHAR2(100), 
      "AMOUNT" NUMBER(21,2),
    CONSTRAINT VOUCHERDET_PK PRIMARY KEY ("V_ID","LINEITEM")ENABLE, 
    CONSTRAINT PUR_SAL_LINE_POD_FK FOREIGN KEY(PROD_ID)
      REFERENCES PRODUCTS (PROD_ID)ENABLE,  
    CONSTRAINT VOUCHERDET_DEBIT_FK FOREIGN KEY ("DEBIT")
       REFERENCES "NOM" ("ACCT_ID") ENABLE, 
    CONSTRAINT VOUCHERDET_CREDIT_FK FOREIGN KEY ("CREDIT")
       REFERENCES "NOM" ("ACCT_ID") ENABLE,  
    CONSTRAINT VOUCHERDET_V_FK FOREIGN KEY ("V_ID")
       REFERENCES "VOUCHER" ("V_ID") ON DELETE CASCADE ENABLE
      );
    
    

    Concerning

    so, instead of this second ActId, choose ACCT_NAME:

  • How to change the background color of selection of the selected item in the drop-down box of choice?

    How to change the background color of selection of the selected item in the drop-down box of choice?

    By default, the selection background color like 'blue', but if I want it to be "yellow" for example, how should I do?

    Thank you

    The id is applied by (I think) the skin of the ChoiceBox class. You don't need to define.

    You must apply the css in an external style sheet. You can apply the external style sheet to any parent of the box of your choice, or on-site (the most usual way to do it).

    Example:

    import java.util.ArrayList;
    import java.util.List;
    
    import javafx.application.Application;
    import javafx.scene.Scene;
    import javafx.scene.control.ChoiceBox;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    
    public class ChoiceBoxTest extends Application {
    
      @Override
      public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("Example 2");
    
        final ChoiceBox choiceBox = new ChoiceBox<>();
    
        List tempResult = new ArrayList();
        for (int i = 0; i < 10; i++) {
          tempResult.add("Item " + i);
        }
        choiceBox.getItems().setAll(tempResult);
    
        VBox root = new VBox();
        root.getChildren().add(choiceBox);
        final Scene scene = new Scene(root, 300, 250);
        scene.getStylesheets().add("choiceBox.css");
        primaryStage.setScene(scene);
        primaryStage.show();
      }
    
      public static void main(String[] args) {
        launch(args);
      }
    
    }
    

    choiceBox.css:

    @CHARSET "UTF-8";
    #choice-box-menu-item:focused  {
     -fx-background-color: yellow ;
    }
    #choice-box-menu-item .label {
     -fx-text-fill: black ;
    }
    

    Post edited by: James_D

  • How to read the value of the selected item in the DropDownList control?

    Hello

    The DropDownList component has a selectedItem property is supposed to return a ListBase.

    But what I want is just the 'chain' which is supposed to be the selected item in the DropDownList control.

    How to read this value?

    Thank you

    -Malena

    You are misreading the documentation. ListBase.selectedItem returns an object. This item comes directly from your data provider, so you just have to go up or go for any property you need.

  • How can I detect when the last container in my stream is full?

    I have a bunch of related containers which I am flowing text through. How can I detect when the text has filled a container? There's an overflowPolicy then I guess it can be detected.

    Hello

    I used this:

    private function IsOverset(textFlow:TextFlow):Boolean

    {

    var zeComposer:IFlowComposer = textFlow.flowComposer;

    var iTextLen:int = textFlow.textLength;

    var iNoController:int = zeComposer.findControllerIndexAtPosition (iTextLen - 1);

    return (iNoController is-1);

    }

    HTH,

    J.

  • Appearance of the selected item

    Overall, I like the appearance of the Explorer of Windows Vista.  However, when an item is selected, the color of the selected item is so light that it is (for me) almost not visible.  I can change the classic theme, but really prefer to make just the darker outline.  How would I go to do this?

    Hello

    Panel Setup/Customize/Windows color and appearance of the control, use the slider to increase the intensity. There is no additional controls beyond that for aero colors. Good luck, Rick Rogers, aka "Crazy" - Microsoft MVP http://mvp.support.microsoft.com Windows help - www.rickrogers.org

  • Retain the selected items on the right side of the shuttle in cascade

    Hello

    I'm under Apex 4.0.2 and have a cascading shuttle point so that a user can filter the left side of the shuttle using the text field.

    However when filter it - the shuttle seems to lose the items already selected on the right side.

    How can I change the element of the shuttle so that the user can always see the selected items, and the filter only works the unselected points (left side)?

    Thank you
    Keith

    Hi Keith,

    I don't have a blog, so there is no post. However, this is what I did:

    1 set the P298_FILTER element to 'Submit when you press enter' and added a branch to the page that redirected to the same page

    2. make the following settings for the P298_SHUTTLE element:

    Cascading LOV Parent article (s): P298_FILTER
    Page items to submit: P298_SHUTTLE
    List of values definition:

    SELECT ENAME d, EMPNO r
    FROM EMP
    WHERE UPPER(ENAME) LIKE UPPER(:P298_FILTER) || '%'
    OR '%' || :P298_SHUTTLE || '%' LIKE '%:' || EMPNO || ':%'
    ORDER BY UPPER(ENAME)
    

    and that is it really. The WHERE clause filters the record based on a filter match or a match with the existing items from the shuttle

    Andy

  • Cant' import images of Photos because "it is not enough free space on the volume of your library to import the selected items.

    Hey guys,.

    So I tried to import some ~ 8 GB of photos on my mac, but the Photos app gives me the following message: "there isn't enough free space on the volume of your library to import the selected items. It is estimated that you need at least X.XX GB of additional free space. »

    Where X.XX represents the amount of GB it says that I need but it changes everytime that I reopen the application to attempt an import.

    My mac has currently 44.4 GB so I don't know why this issue is coming.

    Any help would be great!

    Thanks in advance,

    Andres

    Where is your library?  If it's on an external HD and how the drive is formatted?

    Have you tried to repair the library according to this document from Apple: library of your repair?

    What version of PHotos do you use?

  • How to disable all the selections at once?

    How to disable all the selections at once?

    If you are referring to the playlist, artist, album & kind selection boxes, then I don't think that there is a way to uncheck those all at once.

    If you mean the boxes in the view of songs Ctrl + click and the checkbox to check or uncheck all of the boxes. Note, however, that the use of these boxes is a bad way to manage the synchronization. Uncontrolled songs are ignored in the normal course of track in track or shuffle playback. Better to use one or more playlists to control what is synchronized and have checked most, if not all of your library. Items not controlled in my library are things like interview bonus tracks that had never what to hear accidentally, I keep in my library.

    TT2

  • Is it possible to have windows to automatically select a spare printer by default when the selected default printer is off line?

    I use a laptop and move between two locations each with its own printer.  Whenever I move, I have to change the default printer by opening printers & faxes from the control panel.  Is it possible to have windows to automatically select a spare printer by default when the selected default printer is off line?

    Hi Tom,

    If the default printer is not in offline mode, it will detect the different printer but it will not be a default one.

  • To access the selected items in a ListBox control

    In LabVIEW 2010, I have a ListBox control. How can I get a list of the objects that the user selected in the ListBox?

    I don't see any method, property or event that would provide this information.

    Thank you.

    The value of the ListBox are the indexes of the selected items.

    If you allow the user to select "0 or more' items, the data type will change in a table."

    To get the names of the selected items (I guess that is what you want), you should India property 'element names.

    Tone

  • get the values of the selected items to RichSelectManyChoice

    Hi all

    I have a RichSelectManyChoice

    When the user clicks on the "submit" button I want to get the values of the selected items...


    ----------------------------------------------------------page.jspx-----------------------------------------------------------------------------

    <? XML version = "1.0" encoding = "UTF - 8"? >

    " < = xmlns:jsp jsp:root ' http://Java.Sun.com/JSP/page "version ="2.1"xmlns:f =" " http://Java.Sun.com/JSF/core "

    ' xmlns:af = ' http://xmlns.Oracle.com/ADF/faces/rich "> "

    < jsp:directive.page contentType = text/html"; Charset = UTF - 8 "/ >

    < f: view >

    < af:document title = "untitled1.jspx" id = "d1" > "

    < af:messages id = "m1" / >

    < af:form id = "f1" >

    < af:panelGridLayout id = "pgl1" >

    < af:gridRow height = "100%" id = "gr1" >

    < af:gridCell width = '100% ' halign = "stretch" valign = "stretch" id = "gc1" >

    <! - content - >

    < af:selectManyChoice value = "#{bindings." CountriesView1.inputValue}.

    label = "#{bindings." CountriesView1.label}"id ="smc1.

    valuePassThru Binding = "#{suspect." Country}"="true">

    < f: selectItems value = "#{bindings." CountriesView1.items}"id ="si1"/ >

    < f: validator binding = "#{bindings." CountriesView1.validator} "/ >"

    < / af:selectManyChoice >

    < / af:gridCell >

    < / af:gridRow >

    < / af:panelGridLayout >

    < text af:button = "Button 1" id = "b1" action = "#{suspect.valide}" / >

    < / af:form >

    < / af:document >

    < / f: view >

    < / jsp:root >

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

    --------------------------------------------------------------------suspect.java-------------------------------------------------------------------

    package test.view;

    import com.sun.org.apache.xpath.internal.operations.String;

    Import oracle.adf.view.rich.component.rich.input.RichSelectManyChoice;

    public class suspect {}

    RichSelectManyChoice campaign private;

    String string = null;

    public suspect() {}

    ????????????????????????????????????????

    }

    public void valide() {}

    }

    {} public void setCountry (RichSelectManyChoice country)

    This.Country = country;

    }

    public RichSelectManyChoice {} getCountry()

    back country;

    }

    }

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


    Anyone has an idea please?

    Hello

    You can use

    JUCtrlListBinding listBindings = (JUCtrlListBinding) getBindings () .get ("CountriesView1");

    Object [] str = listBindings.getSelectedValues ();

    for (int i = 0; i)< str.length;="" i++)="">

    System.out.println (STR [i]);

    }

    in this loop, you will get all the values of selectManyChoice, for details see Ashish Awasthi (Jdev/ADF) Blog: using the selection Multiple (component selectManyListbox & selectManyCheckbox) in ADF

    hope it helps

  • Outline around the selected items of OCD

    WebHelp. RH9

    I just installed IE9 and when I run my published WebHelp and select a link in the table of contents, it displays an image dotted around the selected item. This never happened with IE8, so I was wondering if there is anyway to prevent it? Is it possible to add a "outline: no ' somewhere in the RoboHelp output (as you would in styling a CSS link) so that it does not appear?

    Thank you very much

    Jonathan

    Hi Jonathan,.

    Unfortunately, IE was a nut that is more difficult to crack than I imagined. The problem is that IE9 supports the css schema, but the table of contents is running in mode of whims so no goodness IE9 it... There is a solution, it's just not as easy as I thought. See http://www.wvanweelden.eu/robohelp/modifying_webhelp/remove_outline_in_toc for a step by step guide to get rid of the sketch.

    Note: If you let me, I would use your example on my site image. It seems much better than the image for example, I added

    Take a bow

    Willam

Maybe you are looking for