Tag Archives: selectedItem

Creating three related Spark DropDownList controls in Flex 4

In a previous example, “Creating two related ComboBoxes”, we saw how you could create two or three related MX ComboBox controls in Flex 3 by binding to the previous ComboBox control’s selected item.

The following example shows how you can create three related Spark DropDownList controls in Flex 4 by using databinding and XML.

Continue reading Creating three related Spark DropDownList controls in Flex 4

Setting the selected item on the FxButtonBar control in Flex Gumbo

In a previous example, “Setting the selected index on the FxButtonBar control in Flex Gumbo”, we saw how you could set the selected index on a Flex Gumbo FxButtonBar control by setting the selectedIndex property.

The following example shows how you can set the selected item on a Flex Gumbo FxButtonBar control by setting the selectedItem property.

Full code after the jump.

Continue reading Setting the selected item on the FxButtonBar control in Flex Gumbo

Preventing specific items from being selected in a Flex Tree control

In a previous example, “Preventing branches from being selected in a Flex Tree control”, we saw how we could prevent users from selecting branches (folders) in a Tree container in Flex by using the itemClick event and the Tree class’s dataDescriptor.isBranch() method.

The following example shows you how you can prevent any item from being selected by adding an attribute (named “clickable”, but you could name it anything you wanted) and using E4X expressions to determine if the currently clicked item should be selectable or not.

Full code after the jump.

Continue reading Preventing specific items from being selected in a Flex Tree control

Preventing branches from being selected in a Flex Tree control

The following example shows you how you can prevent users from selecting the branch (folder) items in a Tree control in Flex by listening for the itemClick event and using the Tree class’s dataDescriptor.isBranch() method to determine whether the currently selected item is a branch, and if so, deselect the item.

Full code after the jump.

Continue reading Preventing branches from being selected in a Flex Tree control