Flex - Show/Hide ComboBox based off selection - apache-flex

Is it possible to show or hide a comboBox based off the selection made in another comboBox. I have been looking for documentation on this to no avail.
Thanks

Yes, in a Change handler of ComboBox1 set ComboBox2's visible property to false based on the selected item.

Along with setting the combobox's visible property, if you want the form to act as if the combobox is not there, also set the includeInLayout property.

Related

Flex 4.5: Custom component doesn't get visible in custom ItemRenderer

I'm developing a dynamic ItemRenderer to edition in line for Spark DataGrid.
With the Click event on Edit button (first column), I'm refreshing the cell's row using grid.invalidateCell(x,y); inside this custom ItemRenderer, in the function prepare, I'm evaluating an 'editing' dynamic property to hide/show (.visible/.includeInLayout) the default Label or Control for edition; I'm not using actually the itemEditor DataGrid's operation, just simulating this functionality.
Everything goes well with standard spark components for edition: TextInput, ComboBox, etc, but custom components (extended from SkinnableContainer) doesn't get visible, just randomically on first row sometimes.
Is there any specific interface that custom components must implement to work inside an ItemRenderer??
The problem was this property: customComponent.includeInLayout; once you set it to false, it has problems to get visible again. I think it's bad idea to use includeInLayout inside an ItemRenderer.
Now I'm working only with .visible=(false/true) and .x coordinate.
Thanks.

Flex:how to disable particular item in combobox?

I have ComboBox With ArrayCollection as DataProvider. Data will come from Databse as ArrayCollection. I'm Adding Item to ArrayCollection "-Select Item-" at 0th index and setting selected index=0 for combobox.
My question is How to disable that(-select Course-) item?
I recommend you to use prompt property of DropDownList or ComboBox for that and combine it with selectedIndex = -1 as initial value.
Worst case an item renderer to show things as disabled. Then simply ignore the click if it has the property disabled. (this implies your list is overloaded with a property like isDisabled.
Mylist.selctedItem.isDisabled

Flex 3: TextInput as ItemRenderer for CheckBox in ComboBox?

I need to create a Flex component similar to ComboCheck (by Arcadio Carballares).
What I need is a ComboBox with CheckBox and TextInput instead of Checkbox's label.
If CheckBox is selected the TextInput is enabled and editable, other way it's disabled.
Do you have an idea of the easiest way to achieve it?
Create an itemRenderer containing the check box and text input (and code to toggle the editable/enabled prop on the text input), and use that in your combo box as itemRenderer.

Setting a custom itemRenderer in a Flex3 ComboBox on specific list items after combobox creation

I'm trying to set a specific list item in a mx combobox to have a custom item renderer, the problem is that I cannot do this via mxml, it needs to be done via actionscript at a later stage, eg: combobox gets created, combobox gets populated, user does other tasks, combobox needs to set one or more items in the combobox to have icons (via item renderer)..
I can do this via the onChange event, but it only applies the icon when the combobox is opened and there is a slight delay so you can see the icon being added.
Thanks in advance for any help
J
The normal answer for this is to not do this in the onChange, but to change something in the ComboBox's dataProvider and let the itemRenderer handle it instead.
i.e. in the itemRenderer
<mx:Image id="icon" source={data.icon} visible={data.icon} includeInLayout={data.icon} />
Setting the icon property in whichever item you want to show the icon for. If icon is null, nothing gets shown.

Displaying checked items in CheckedComboBox in DevExpress using C#.net

My current CheckedComboBox has a large list of items. I need to have selected list out of those items checked when the drop down is clicked. e.g CheckedComboBox will have P,Q,R and S as the itmes. But only P will have a tick in front of it.
Is there a property for this defined already?
Thanks
The CheckedComboBox control does not provide the CheckedItems (or SelectedItems) property .Use the editor's EditValue property to determine which Items are selected.

Resources