Flex :: Find Out Deselected Item In Spark List With Multiple Selection

Aug 3, 2010

In a spark list I could use the change event to find out which item has been selected or deselected. The dispatched IndexChangeEvent object has the properties newIndex and oldIndex holding this information.

But with multiple selection allowed this doesn't work anymore because newIndex and oldIndex could refer to indices of still selected elements.

A solution would be to copy the selectedIndices vector to another variable and compare this variable with selectedIndices after a change in selection, but this seems to be somewhat complex.

Does anyone know if there is an easy way two get the index/item a user is deselecting while other elements are still selected?

View 2 Replies


Similar Posts:


Flex :: Spark List Not Displaying Selection When An Item Is Removed

Aug 3, 2011

I have an issue with Spark Lists whereby I am trying to ensure that an item is always selected and ensure that the GUI displays this to the user.

The application (full code below) creates a List, a Label and a Button. The Label states what is selected in the List. The button removes the selected item. Changing the selection, updates the text in the Label. Important: The List has "requireSelection" set to true to ensure that an item is always selected.

If I select the first item in the List, the selection is correctly reflected in the label. Clicking "Remove" removes the item and the next item is selected. This is all working correctly.[code]...

View 1 Replies

Flex :: Unable To Select Item In Spark.components.List After De-selection

Dec 21, 2010

I have a spark List defined as:

<s:List id="symbolList" dataProvider="{symbolListCollection}" change="symbolNameChangeHandler(event)"></s:List>

With the change handler defined like this:

protected function symbolNameChangeHandler(event:IndexChangeEvent):void {
symbolList.validateProperties();
changeSymbolView(symbolList.selectedItem);
}

and symbolListCollection as an ArrayList filled with Strings.

At first, the change event works fine, and I get what I expect.

However, if I Ctrl-click on the selected item, to de-select it, i am unable to ever select an item again.

When I click on something to try to select it, the change event DOES fire, however, the ItemChangeEvent has both oldIndex and newIndex set to -1

View 1 Replies

Flex :: Get List Item Selection Working When Using A Png Mask In An Item Renderer In A 4.5 Mobile App?

Jun 10, 2011

I'm creating a mobile app in which I need to show a calendar with months at the top. The months are part of a component that extends from SkinnableDataContainer (and has some custom scrolling/behaviour - which is why I did'nt use a spark list). I need the months to be shown as a 'trapezium' shaped tab and so I'm using a png image as a mask in the item renderer for the component.

When the mask is not applied, it all works well - the months render, the list/data container selection works when I click on a month and so on.When the mask is applied, it renders well, scrolling and everything else seems to work well - but when I click on a month, nothing happens visually. And from the trace statements in my code, it appears list item selection is not changing. Looks like mouse clicks are not working.

Code:

public class TopCalendarMonthRenderer extends LabelItemRenderer {
[Embed(source="/assets/trapezium_alpha.png")]
private static var TrapeziumMask:Class;
private static var trapeziumMaskInstance:BitmapAsset;

[code]...

View 1 Replies

Flex :: Spark DataGrid On Mobile Application Handle Scroll And Selection Item?

Dec 15, 2011

I have a spark datagrid on a mobile application, I set the

interactionMode="touch"

and the dataGrid scrolling is good, I got some problems adding a selectionChange eventListener to it, because scrolling the dataGrid will automatically change the selection and instead simply scrolling it, the function binded will start...

How can I add the touch dalay before select the index, so if I scroll the grid the selection won't change, and it change only if I press the item without scrolling?

View 1 Replies

Flex :: Highlight Item In Spark List?

Jun 25, 2010

I have two spark lists and want to drag items from one list to the other. When im dragging an item and over the other list item, i want the target item to change the background coloer.Basically instead of showing the black line indicating that I will drop between elements, I want to see the target item highlight.

View 1 Replies

Flex :: Spark List Item Renderer

Nov 29, 2010

How do I wordwrap in a spark list w/ an itemrenderer? This posting at[URL] works 100% but when I try to set a separate item renderer, I can't get the word wrapping...instead, I get an ugly horizontal scroll bar. HEre is my mxml:

[Code].....

View 1 Replies

Flex :: Get The Item Renderer That Is At The Top Of The Viewport In A Spark List?

Oct 26, 2010

I have a Flex Spark List (well it's a Tree to be precise but it renders as a list) and as I'm scrolling through it I want to provide information about the item that is currently at the top of the list in context to the viewport. So this could be the 100th item in the list depending on how far you've scrolled down.

View 1 Replies

Flex :: How To Add Spark List Item Custom Properties

Jan 3, 2011

I'm trying to make a simple flash application providing interface for taking tests as a high school assignment. One of the requirements is to use an XML file as data source.Now, having a List component bound to the XML file with questions consisting of data such as question body, question type (ie. single choice, multiple choice, open, image etc.) and possible answers (where applicable), I was wondering if I could add some additional data (and what is the best possible way to do so) to each question upon its transfer to the List component.

I am trying to achieve two main goals with this: firstly, to mark the questions to which an answer has already been given, like with such code in ItemRenderer class:
<s:Label color="{data.color}" text="{data.label}"/>
Where data.color would be set whenever the user gives an answer to a question.
Secondly, while at it, I thought of such possibility as a great way to store answers given to particular questions. In this case, the Class of the answer object would have been Object, since there has to be many type of questions (where the answer could also be a Bitmap for example).

View 2 Replies

Flex :: Spark List Selected Item Coordinates?

Jun 17, 2011

I have a list with custom item renderers. What I would like is when one of the list items is selected to position another control OUTSIDE the list to the same vertical position as the selected item.

View 2 Replies

Flex :: Spark List Component Item Order

Oct 17, 2011

I have a regular spark list which is sorted correctly when no item renderer is used. However, when the following item renderer is used, the list shuffles and displays items from previous instances of the list.[code]

View 2 Replies

Flex :: Scroll To Selected Item In Spark List Component?

Oct 21, 2009

I'm setting selected element in s:List component with Actionscript, it works, but List doesn't scroll to selected item -- need to scroll with scrollbar or mouse. Is it possible to auto-scroll to selected item

View 8 Replies

Flex - Spark List Reusing The Wrong Item Renderers?

Feb 9, 2010

I have a List component using multiple item renderers determined by the itemRendererFunction. When I set the data the first time, it works as expected. Then, when I set the data a second time with new data, it doesn't call the itemRendererFunction and tries to reuse the current renderers even though they don't match the data.Once I scroll, the function is called and the correct renderers are used. I tried calling invalidateDisplayList and such prior to setting the data, but that didn't fix the problem.

View 3 Replies

Flex :: Find The List Item Currently Under The Mouse Pointer?

Feb 3, 2010

I have some List and TileList controls. How can I get a reference to the list item that's currently under the mouse pointer?

View 3 Replies

Flex :: Handling Mouse Click 4 List To Find The Selected Item (since ItemClick Is Gone)?

Dec 8, 2011

I have prepared a simplified test case for my question. It will run instantly in your Flash Builder if you put the 2 files below into a project.I'm trying to display a List of strings and a confirmation checkbox in a popup:In the real application I dispatch a custom event with the string selected in the list, but in the test code below I just call trace(str);My problem: if I use click event, then the window closes, even if I click at a scrollbar (the !str check below doesn'twhen an item had been selected in previous use). And if I use change event, then the window doesn't close, when I click on the same item as the last time.riting a custom item renderer and having a click event handler for each item seems to be overkill for this case, because I have strings in the list.Test.mxml: (please click myBtn few times - to see my problems with click and change)

<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"

[code]........

View 3 Replies

Flex :: Combining A Multiple Strings And Arrays To One DataProvider For Spark List

Dec 21, 2010

what I need to do is combine 5 arrays with 5 individual strings (which have come from a JSON webservice) into one single list item in FlashBuilder Burrito. [code]I've pulled these out successfully and each one traces in the debugger, although as I need them all in the same list I'm struggling to establish them as a dataprovider together.If I push the strings and arrays together it is impossible to read properly, as the main Titles are at a different level to any descriptors for the products which are in the arrays.

View 1 Replies

Actionscript 3 :: Flex / Using Multiple Item Renderers In A List

Feb 23, 2011

I'm trying to have multiple item renderers in a list, as I have several different types of objects that I want to display. I tried creating a new class that extends ListBase, and adding override public function createItemRenderer with my code within this function. I then instantiate the new class and give it my array of data as its dataProvider, but createItemRenderer is never called within my new class,

View 2 Replies

Actionscript 3 :: Maintain The Selected Item (instead Of Index) After A Spark List Sorts?

Jan 19, 2011

I change an item in Spark List. The item then moves to a different index in the list since I keep the List's dataProvider sorted. However, the selectedIndex stays where the item used to be. I want the List's selectedIndex to still be on the item that changed.

View 1 Replies

Actionscript 3 :: Spark Images In Spark List With TileLayout Disappear On Scroll And Drag In Flex App

Jul 1, 2011

I have a renderer that looks like this:

[Code]...

Loading thumbnails using this method works perfectly. The issue happens when you scroll the List.

View 1 Replies

ActionScript 2.0 :: Multiple Selection In A List?

Mar 24, 2010

I have a populated list component with multiple selection enabled, on pressing a button i want to know all of the selections that have been selected. Instead i can only find the .getSelectedItem() thing, which only tells me the last selected thing. How would i do what i want to do?

Also, another thing. If i want to select a specific index of the list, how do i do that? I have tried

'_root.roomsAvailableList.index(i).label'
'_root.roomsAvailableList(i).label'
etc. non seem to work.

View 1 Replies

ActionScript 1/2 :: Checkbox List &amp; Multiple Selection?

Aug 17, 2007

I've added checkboxes to a list component using the cellrenderer however the behavior is different from what i expected. I'm only able to check one box in the list at a time. I need to be able to check mutiple boxes in the list.

I'm aware you could hold down the control key and select individual the checkboxes, but the application i'm developing is a touch screen aplication hence no keyboard, no control key. I've tried programmaticaly setting the selectedindicies but the checkboxes don't appear checked after the selectedindices have been set.

View 1 Replies

Flex :: Make List Content Dependant On Selection In Another List?

Jul 6, 2011

When a user selects a category from the first drop down box then i want the 2nd drop down to be updated based on the selection of the first drop down. I have created multiple ArrayCollections whose names are set to the "data" values of the first drop down, for instance:

[Bindable]
public var countries:ArrayCollection = new ArrayCollection([
{label:"USA",data:"USA"},

[code].....

View 2 Replies

Flex :: MX List ItemRollOver Event Equivalent On A Spark List Control?

May 26, 2011

Flex 3 List control had a itemRollOver event. Flex 4 List doesn't have it. Is there an equivalent or a workaround for this issue?

View 2 Replies

Flex :: Set The Selection Border Color In Spark Datagrid

Jun 29, 2011

I have a custom skin applied to a Flex 4 spark datagrid. One really annoying issue I am having is finding the ability to override or change the selected row border color. I was able to set the selectionColor just fine but the border is still the default light blue color. I need it to be yellow.

Anyone know where I can find this style or override this border that is being set when selection happens within the skin itself.

View 2 Replies

Flex :: Spark List Have Something Similar To ItemsChangeEffect In Mx List?

Jun 28, 2010

I'm trying to animate a list as I delete the top row. All the examples I can find use itemsChangeEffect to bind to the effect, but this property exists only in MX lists, not spark lists.

Any idea how I can get the same effect done in Spark Lists?

I'm trying to remove the top most item in the list with a slight fade out effect before the rest of the items move up to replace the gap.

View 2 Replies

Flex :: TileList Item Selection?

Sep 1, 2009

In my TileList, I want to select the TileList items on rollover, as opposed to the click event. I already have the TileList setup to allowMultipleSelection = "true".

View 3 Replies

Arrays :: Flex DropDown Selection Not Working When Search For Item?

Nov 26, 2011

so here is the problem that I have so far. I tried to simplify my code so I can attempt to figure this out, but I have had absolutely no luck. I have a viewstack that contains 1 dropdown per stack. They share the same data provider. What I want to do is to select the item contents from the first one. Once I do that, when I click a button to the next stack I have a function that searches from index 0 to the dataprovider length and if the item from the first stack matches the second one, I want to have the second dropdown pick that item up and display it. I have it matching, and I try to select it, but when I run the application it shows up like nothing is selected. Here is what I have:

edit: I got it to work for a simple example, but when I attempt to use it in my more complicated example, on that button click it for some reason resets the value of selectedIndex to -1. How do I prevent this from happening? This is working code for the simple example

[Code]...

View 1 Replies

Flex :: Spark ComboBox Displaying Text For New Item?

Sep 16, 2010

I've been playing with s:ComboBox and generally like them a lot. One detail is driving me nuts though - most likely due to my lack of knowledge in the subject - is that if I try to add a new item to my dataprovider in a changeHandler (registered to the change event) the text for the ComboBox textInput disappears - although the item addition works perfectly. Interestingly enough the same operation works fine if it gets called by clicking on a button, i.e. post the change event has been processed, and the text does not disappear.[code]if you take out the change handler you will see that adding a new item and then clicking on the button keeps the new element in the textInput while adding the item to the data provider, which does not happen if you just enter a new item and press enter.

View 1 Replies

Flex :: Changing Space Between Spark Form Item?

Feb 26, 2011

Is there a way to change the space between a spark form item and its content (textinput, combobox)? I already set to 0 the "gap" property of the form, but still there is a lot of vertical space left between the form inputs.

View 5 Replies

Actionscript 3 :: Flex 4 Remove Selected Item From Spark DropDownList

Jun 30, 2011

My stakeholder has a request to remove the currently selected item from the DropDownList control(s) in the application. For example a drop down with [item1, item2, item3, item4] if item2 is selected then the only items in the drop down will be [item1, item3, item4]

Using Flash Builder 4 with Flex 4.0 sdk

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved