Flex 3: TextInput as ItemRenderer for CheckBox in ComboBox? - apache-flex

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.

Related

How do I make RadioButton and TextField disappear?

Hi l want to make RadioButton and TextField disappear After the user completes the required data so that he or she will replace it as a result of the test
You can use the setVisible(boolean) methods on an Node to hide your elements. Your code would look like this, assuming your radio button is named radioButton and your text field textField, respectively.
radioButton.setVisible(false);
textField.setVisible(false);

Flex - Show/Hide ComboBox based off selection

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.

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.

How to change datagrid cell's itemRenderer dynamically

i have a simple datagrid having 2 columns named as image and place. where image column has mx.controls.Image itemRenderer and place is simple. my requirement is to change itemRenderer of image cell when it will be clicked. i means to say when user click on any image from image column than i want to show that image path in editable mode and when user edit that path then the selected cell will start displayed the updated image.
i dont know how to do this and getting depressed . please anyone help me ! :(
You don't need to change itemRenderer for that - just implement that code in your single item renderer. You can add listeners inside it and change the contents of the current cell.
I suggest when going into editable mode for your DataGrid: Also create an itemEditor for your Image column, make it an extended TextInput class. This extended TextInput class will change the data object's imageAddress/url when you are done editing ("itemEditEnd" event).
Let me know if this helps, thanks!

Flex3 Combobox doesn't display itemRenderer when closed

I have a combobox with a custom itemRenderer. The ItemRenderer displays some images and a label.
When the combobox opens, the items in the dropdown list display perfectly, but when its closed, the combobox doesn't use the ItemRendere, but shows "[object MyItem]". Do I need another attribute to indicate that the ItemRender also needs to be used when closed?
This is my tag:
<mx:ComboBox dataProvider="{myItems}" id="itemsCombo" itemRenderer="org.test.myComboBoxItemRenderer" />
you need to set the labelField or labelFunction property on the combobox to show the same thing as your itemrenderer.

Resources