By clicking on specific items in a list

Hey there,

I am completely new to this (development of applications in general) so I apologize if these questions seem super simple.

I created a list that appears on the half left of my screen, and I'm trying to load a second list based on which item in the list is selected.

I am able to get the second list is loaded, but any item is selected in the first list, it still load the same. How can I specify what loading list?

Thanks again. I searched on the forum and read multiple adobe resources and can't seem to understand this one.

Well, ithink there are many solutions to your problem, but in my humble OPINION.

I would not creat the rightlist where the Manager, instead, I got creat that it outside and just sets the data provider in the array/Collection you want as a result.

i.e.

rightlist = new List();
rightlist.dataProvider = myData2;
rightlist.setSize (list.width = 512 list.height = 300);
rightlist.setPosition (512, 300);
rightlist.selectionMode = ListSelectionMode.SINGLE;
rightlist.allowDeselect = true;
rightlist. Scrollable = true;
rightlist.scrollBarAlpha = 0.5;
rightlist.graphics.beginFill (0x5eff62, 1);
rightlist.graphics.endFill ();
addChild (rightlist);

list.addEventListener (ListEvent.ITEM_CLICKED, onClick);
}
            
private void onClick(e:ListEvent):void {}

If (leftlist. SelectedIndex == 0) rightlist.dataProvider = myData2

else rightlist.dataProvider = myData3;

You can make the switch box or something fancy you like...
}

It's the easiest way I think (with the exception of the link etc). But you can do many more things facny also...

Tags: BlackBerry Developers

Similar Questions

  • Removal of specific items in a list

    Hi all
    I have the following problem:

    I have a list on stage component.
    I have 10 items in the list, selected index is 5.

    Now I want to remove all items above 5 (6-10).
    In my view, that a table would be a solution but I'm not so good with this so I need your help.

    Thank you
    Simon

    If the instance of your list name is myList, then the following code removes all items after the currently selected element:

  • Items in the list does not appear under the current name?

    Hello

    I use the model 12 and by using the vertical sidebar list. When I click on an item in the list that I want to make current and the rest non-current, but when I discovered the source of each of them is still displayed with a class of "t12noncurrent".

    That's what my model looks like under the definition of the model:

    For "current model list.
    <tr style="padding-bottom: 5px;"><td><a class="t12current" href="#LINK#">#TEXT#</a></td></tr>
    and for "related model list.
    <tr style="padding-bottom: 5px;"><td><a class="t12noncurrent" href="#LINK#">#TEXT#</a></td></tr>
    No idea why its not current selection?

    Hello

    It is not part of the model but the definition of the list itself. Go to select the shared components, lists, your list, and then select a list entry. Here, you should have an input section of the current list with two parameters:

    Current entry list for Pages Type: value "Colon delimited list Page.
    The current list entry for Condition: enter the page number (which should be identical to the Page parameter in the target section)

    Andy

  • How to select and move more than one bookmark at a time? Shift + click selects multiple items that are next to each other in a list, because the element

    How to select and move more than one bookmark at a time?
    Shift + click selects multiple items that are next to each other in a list, because the items open in firefox before that happens.

    Glad it worked for you. Thanks for posting back.

  • Capture, click the item inside the list itemRenderer

    Hello!

    I have a list that opens a window when an item is selected.

    However, I also have an image of 'delete' in the upper right corner of the component of the itemRenderer that when you click on should do something else.

    How can I make sure that when the image is clicked the click does not select the list item, and when the user clicks anywhere else, it is by default in the selection of the item in the list.

    Thank you!

    You will not find a simple way to alter the events of the list control. You are better off simply switch to MouseDown.

  • ADD ITEMS TO THE LIST DROP-DOWN LIST TO A TEXT FIELD (USER ENTERS THE ITEM) AND ALSO RELATED TO VALUE

    Untitled.jpg

    I have WANTED to ADD of ELEMENTS from the list drop-DOWN OF THE AREA of TEXT (the ELEMENT NAME) WHERE the USER BETWEEN of THE DESCRIPTION of POINT

    AND RELATED value SHOULD ALSO BE ADDED to THE SAME ELEMENT.

    LIKEWISE REMOVE ITEMS IN THE DROP-DOWN LIST

    PLEASE GIVE SHAPE TO SAMPLE OR JAVASCRIPT FOR THE ABOVE SCENARIO...

    INDEED USEFUL FOR MY PROJECT PLEASE SEND PDF FORM

    Hi Praveen,

    You can add items to the list in a specific order, which would be to load the elements in an array, sorting and then load in the dropdown list drop-down list.  This would be in the click event of the button Add.

    Create a table to hold all the list items, table drop-down list contains objects with a property 'displayItem' and 'value '.

    dropDownItems var = [];

    Add the new

    dropDownItems.push ({displayItem: ItemName.rawValue, value: BoundValue.rawValue});

    Add existing ones

    for (var i = 0; i)< dropdownlist1.length;="">

    {

    dropDownItems.push ({displayItem: DropDownList1.getDisplayItem (i), value: DropDownList1.getSaveItem (i)})

    }

    Sort by ascending order of displayed text

    () dropDownItems.sort

    function (a, b)

    {

    If (a.displayItem< b.displayitem)="" return="">

    If (a.displayItem > b.displayItem) return 1;

    return 0;

    });

    clear all items

    DropDownList1.clearItems ();

    load the sorted items

    for (var i = 0; i)< dropdownitems.length;="">

    {

    var dropDownItem = [i] dropDownItems;

    DropDownList1.addItem (dropDownItem.displayItem, dropDownItem.value);

    }

    clear the fields of the source

    ItemName.rawValue = null;

    BoundValue.rawValue = null;

    I added a button 'Add' sorted in my sample https://workspaces.acrobat.com/?d=OwysfJa-Q3HhPtFlgRb62g

    Concerning

    Bruce

  • For the last two weeks, when I click on an item in Daily Kos, it does not open, but rather a box pops up saying "allow" that I have to click. -What happened?

    Daily Kos is a site that collects over the web and passes them along. To read the articles, I click it in the list. Suddenly, about 2 or 3 weeks ago, when I clicked on an item, the page came in white with a small block in the upper right corner, saying "allow." Now I have to click "allow" every time, instead of just go to the item when I click on it. What's past and how to fix it?

    Enable the redirection page...? Many users seems to be turned on an accessibility function accidentally. To disable the block of redirection, you can use the Panel Advanced preferences page:

    "3-bar" menu button (or Firefox) > Preferences > advanced

    Under the mini general tab in the accessibility section, uncheck the box for "warn me when websites try to redirect or reload the page.

    What is fix?

  • How can I remove an item from my list of downloads on my Mac (10.6.8)

    I recently downloaded something on a website and it appeared naturally in my download list. For some reason, I wasn't careful and downloaded a second time. After you open the download I realized I didn't even download. I can't remove it from the list. I don't want to hit clear list because I still want a record of what I downloaded. Please help if you can.

    Control-click on the item and select 'remove from list '.

  • failure of the deletion of an item in a list

    Hello

    I am new to AIR und QNX and try to work through documentation of the RIM.

    Now, I'm at http://developer.blackberry.com/air/documentation/playbook/ww_air_developing/Create_a_list_ms_197099...

    The program creates a list. If I click on a button, it should remove an item from the list. But it doesn't work. Maybe someone has an idea why?

    Just a second question:

    Is there a difference between these two lines? Which variant is to be preferred?

    myList.removeItemAt (1);

    myList.dataProvider.removeItemAt (1);

    Here the important parts of the code:

    Import qnx.fuse.ui.listClasses.List;

    private function initializeUI (): void

    {

    arrMonth.push ({label: "Jan"});

    arrMonth.push ({label: "Feb"});

    ...

    myList.dataProvider = new DataProvider (arrMonth);

    }

    private void myButtonEvent(event:MouseEvent):void

    {

    now remove an item

    option 1: works well!

    myList.removeItemAt (1);

    HERE, THE ERROR SE PRODUCT

    option 2: does not work

    error message: the item to remove is not found

    myList.removeItem ({label: "Jan"});

    I still don't understand the etiquette thing. So I tried that, but it didn't work either

    myList.removeItem ("Jan");

    }

    Thank you very much

    Sebastian

    RemoveItem, you give him the real object that was originally registered on the data provider (pointer reference). You cannot give a new object that has the same values of the original object. If you don't, then you must create a function that makes a loop on your table of data provider and compare the unique field (usually, 'data') of the object is passed to, then call removeItemAt, based on the index in the array.

    It is also a good idea to not rely on the label to be unique in the list. AS3 convention will usually have a 'data' field that is unique for the list. The data field can then be matched to. Without it and you have multiple items with the same label, will lead to problems of selection.

  • How to enable recent items on jump list

    Not sure if it of a problem or not. I would like a list of recent items on my list of jump (in fact, only for MS Word) in the task bar. I only have pinned files, but would like to be able to place a file in the list of recent files and PIN which as well. My problem is that I do not see the recent files on any list to jump from a program in the task bar. I went into the properties of taskbar (start menu/customize) and tried to click on the number of recent files, but it is zero and is grayed out so I can't change it. What should I do? Or is it a problem that requires a repair?

    I've seen a few discussions about this in this forum - I don't know if this is a problem, or if there is somewhere a seting I forgot to check.

    Right-click on the Start button, and then select Properties. Click on Start menu tab and check the box in front of the store and display recently items in the start menu and the taskbar.

    http://Windows.Microsoft.com/en-GB/Windows7/whats-new-with-the-Windows-7-taskbar

    http://www.SevenForums.com/tutorials/14067-Jumplist-Launcher-create-custom-jump-lists.html

  • Show the different regions by clicking on the entries in the list

    Hello world

    I have a page with several regions, but I want to only show one at a time; I want you to show with a checklist. So, whenever I click on an entry in the list, I want to see a specific region and if a click on a second entry in the list, I want to see another. It must be without submitting the page (for different reasons).

    An example of I want to do is when you change an element in the APEX; You can see a list of buttons 'Show all', 'name', 'Displayed', 'Label', 'Settings', etc. Function of the key, you click, you will see a different region.

    I think it is a very sleek and elegant way to show a lot of information to users, if only I could apply it... any ideas? :)

    Thank you
    Elena.

    Elena.MTC wrote:

    I have a page with several regions, but I want to only show one at a time; I want you to show with a checklist. So, whenever I click on an entry in the list, I want to see a specific region and if a click on a second entry in the list, I want to see another. It must be without submitting the page (for different reasons).

    An example of I want to do is when you change an element in the APEX; You can see a list of buttons 'Show all', 'name', 'Displayed', 'Label', 'Settings', etc. Function of the key, you click, you will see a different region.

    I think it is a very sleek and elegant way to show a lot of information to users, if only I could apply it... any ideas? :)

    4.1 the best way to proceed is to use the integrated Region Selector display.

    After you have created the RDS, customization is necessary to display only one region at a time.

    1 hide the RDS "Show all" link (and change the second link to resemble the first) by adding this stylesheet in the header HTML page:

    
    

    2. by default, all regions will be displayed when the page is loaded. Hide others using dynamic Action to simulate a click on the first link in the region of the RDS and the first region:
    H4. When

    Event: Page load
    H4. Real Action

    Action: Run the JavaScript Code
    Fire on loading the Page: No.
    Code:

    $('.apex-rds-container li:first-child+li a').click()
    

    See this article to view region selector sticky if you want the value of the visible area to be preserved if the page is refreshed.

  • How can I select multiple items in the list of the spark without pressing the command?

    Hi all

    I need to change the behavioral list to allow multiple selections by clicking on each item

    In the list, instead of using the control

    30:

    Elazar r

    This blog explains how: http://flexponential.com/2009/12/13/multiple-selection-in-a-spark-list-without-the-control - key /

  • Activation click on the Item Renderer only event

    Hey. I'm working on a s:list and a click event problem. I have everything works just fine on the component and linking, but as you probably guessed, the event cues when whatever it is on the s:list is clicked, including the scroll bar or an empty space.

    Is there a quick fix to make the tail only event when the user clicks on an Item Renderer inside the list? Help would be very appreciated, I tried to solve this problem for a while.

    Thank you!

    RKaster

    Hi RKaster,

    do you need the reference for the element by force converter or could you immagine a different approach? If you could work around this, you can use the change event instead of the click event. The change event gets fired whenever the selection of items in the list change. Click on an element of rendering of course will change the selection if the underlying element is already selected.

    If you can't get around the need for a reference point renderer that you should experiment with the List component mouseChildren property (inherited from the DisplayObjectContainer, see http://bit.ly/dhqCFS). IMHO of course

    Kind regards

    Thilo

  • I can't click on menu items at the top of page 1/3 of the page, unless I'm csan scroll down. (Which does not always for log-ins, etc..)

    I can't click on menu items, such as log-ins if they are at the top of the page. If they are in the middle or the bottom, it works. An example, I can't click the button/Inbox notifications on Facebook.

    Extension of installed Yahoo toolbar?

    If so, disable it.

  • Selecting the item in a list of images

    Hi @ll,

    I tried to get the selected item in a list of images (bbui - 0.9.2.js). If I try to get the selected item as described here

    https://github.com/BlackBerry/bbUI.js/wiki/image-list

    .. .the result is still "not defined".

    Here is my snip of code:

    var mc;
    var bb10HighlightColor = '#00A8DF';
    
    bb.init({bb10HighlightColor: bb10HighlightColor,
          bb10ActionBarDark: true,
          bb10ControlsDark: true,
          bb10ListsDark: false,
          bb10ForPlayBook: true,
    
          onscreenready: function(element, id) {
             if (id == 'dataOnLoad') {
           dataOnLoad_initialLoad(element);
        } else if (id == 'imagelist') {
                var resultList = element.getElementById('resultlist');
                for (var i = 0; i < mc.count; i++) {
                   var item = document.createElement('div');
                   item.setAttribute('data-bb-type', 'item');
                   item.setAttribute('id', mc.contactarray[i].ID);
                   item.setAttribute('data-bb-title', mc.contactarray[i].Company);
                   item.setAttribute('data-bb-img','img/company.png');
                   item.innerHTML = mc.contactarray[i].Zip + " " + mc.contactarray[i].City;
                   item.onclick = function() { onItemSelected('test'); };
                   resultList.appendChild(item);
                }
             }
          },
    
          ondomready: function(element, id) {
          }
    });  
    
    function doSearch() {
       parseJASONAndOpenList('{"count":3,"contactarray":[{"Company":"Acme Inc.","Lastname":"Jackson","Firstname":"Bill","City":"Maincity","ID":"45D6"},{"Company":"Backman Inc.","Lastname":"Burger","Firstname":"Marc","City":"Downtown","ID":"45D7"},{"Company":"Jingle Inc.","Lastname":"Sampson","Firstname":"John","City":"Outercity","ID":"45D8"}]}');
    };
    
    function parseJASONAndOpenList(jsonString) {
       mc = JSON.parse(jsonString);
       bb.pushScreen('imagelist.htm', 'imagelist');
    };      
    
    function onItemSelected(text) {
       alert(text);
       var selectedItem = document.getElementById('resultlist').selected;
       alert(selectedItem.getAttribute('id')); //selectedItem is always undefined here
    }
    

    The image list:

    
    
    
    
    
       
    Test item

    The image list holds something hard (id = "TEST1"), then I add three objects dynamically. After selecting one of the items, I would like to show more details in a new screen.

    I tried to solve in different ways, but the result of

    var selectedItem = document.getElementById('resultlist').selected;
    

    is always "not defined".

    I'm looking for any help!

    Hello!

    This javascript interface comes in 0.9.3 still not available in the version you are using.

Maybe you are looking for