Hi
I am accessing the combobox with the id through
object.data = event.currentTarget.itemEditorInstance.foo.SelectedItem
it works fine, but the problem I have is, when I click on the combobox in the
gird, it defaults to the first item in the dataprovider for the combobox
<combobox id="foo" dataprovider={dprovider} text="{data.DataField}
labelField="datafield" />
the dprovider has the value cb1,cb2,cb3
when I click on the cell in the datagrid, the combobox is populated with cb1
irrespective of the value selected.
I have also tried
<combobox id="foo" dataprovider={dprovider} selectedItem = data.DataField}
labelField="datafield" />
this shows a blank combobox when clicked on the cell.
in both the cases it does give a warning
"unable to bind to property 'datafield' on class object
any suggestion
Thank you
--- In [email protected], "Goutham" <goldensu...@...> wrote:
>
> Hi Alex,
>
> thank you, I tried it using an id for the combobox, gives me an error
> "Access of possibly undefined property foo through a reference with static
> type mx.containers:Grid"
>
> and there is also another problem, when I click on the column in the
> datagrid, the itemeditor changes to a combobox with the default value to be
> the first one in the dataprovider instead of the selected one
>
> this didn't happen in the first case (first case I mean with out using the
> grid and gridrow) but here, I get a warning "uable to bind to property
> 'datafield' on class 'object' (class is not an IEventDispatcher)
>
> any suggestions
>
> thank you
>
> --- In [email protected], Alex Harui <aharui@> wrote:
> >
> > One way is to set an id="foo" on the ComboBox, then use
> >
> > object.data =
> > ComboBox(Grid(event.currentTarget.itemEditorInstance).foo).text;
> >
> > On 6/2/10 1:00 PM, "Goutham" <goldensuits@> wrote:
> >
> >
> >
> >
> >
> >
> > Hi,
> >
> > I have a combobox in item editor in a datagrid. the combobox is populated
> > with a dataprovider. All this works fine until I place this combobox inside
> > a gird
> >
> > working code
> > ------------
> >
> > mxml code
> > ---------
> >
> > <datagridcolumn>
> > <itemeditor>
> > <component>
> > <combobox dataprovider="{outerDocument.data}" ... />
> > </component>
> > </itemeditor>
> > </datagridcolumn>
> >
> > actionscript code
> > -----------------
> > object.data = ComboBox(event.currentTarget.itemEditorInstance).text;
> >
> > problematic code
> > ---------------
> >
> > <datagridcolumn>
> > <itemeditor>
> > <component>
> > <grid>
> > <gridrow>
> > <griditem>
> > <combobox dataprovider="{outerDocument.data}" ... />
> > </griditem>
> > </gridrow>
> > </grid>
> > </component>
> > </itemeditor>
> > </datagridcolumn>
> >
> > actionscript code
> > -----------------
> > object.data = ComboBox(event.currentTarget.itemEditorInstance).text;
> >
> > error in the action script code:
> > ---
> > cannot convert _inlinecompone...@3780479 to mx.controls.ComboBox
> >
> > Here the itemeditorinstance is a grid so, probably its not able to convert
> > to combobox, how do we get the selected value of the combobox from the
> > itemeditor ?
> >
> > I use the grid, as the rows are of variable height and the combobox looks
> > huge if the height of the row is more
> >
> > Thank you
> >
> >
> >
> >
> >
> >
> > --
> > Alex Harui
> > Flex SDK Team
> > Adobe System, Inc.
> > http://blogs.adobe.com/aharui
> >
>