views:

116

answers:

2

I have the follwoing. :

mx:DataGridColumn width="125"  headerText="Time" editable="false"
mx:itemRenderer
mx:Component
            mx:HBox
                   mx:NumericStepper id ="TimeHour"    stepSize="1" minimum="0" value="0" maximum="23"/
                   mx:NumericStepper id ="TimeMinute"  stepSize="5" minimum="0" value="0"  maximum="55"/
            /mx:HBox
                    /mx:Component
   /mx:itemRenderer
/mx:DataGridColumn

How do I provide values from the dataprovider (which is an array of objects) to these individual numeric steppers. dataField cannot be mentioned in the NumericStepper tag it seems.

Help.

P.N : IGNORE Start tag and End tgs of the mxml. Question is not being displayed correctly.

+1  A: 

If I'm not misstaken you can access the data like this: < mx:NumericStepper value="{data.yourValue}" />

Christofer Lundstedt
Ok...One thing, wat is "yourObject" here. Is it directly the parameter name of my dataprovider name. If I give directly parameter name, it says unable to bind to parameters, inspite of declaring bindable.
It should read yourValue, I have edited my original comment. data is the current object in your array so yourValue is a property on that object.
Christofer Lundstedt
I tried the above. It sayswarning: unable to bind to property 'TimeHour' on class 'utils::TimeDO'
That is a fairly common warning and should not affect the outcome of the code. http://bugs.adobe.com/jira/browse/SDK-13814
Christofer Lundstedt
ok...but,the values dont get displayed.
A: 

Binding warnings should never be ignored. They're telling you that the property you're trying to use at runtime is actually bindable and changes to its value will not be propagated i.e. you won't see changes to data in the view. Since itemRenderers instances are recycled, and thus, have their data properties changed repeatedly as the user scrolls the list, grid, etc. you basically won't get what you want.

There's a couple of things you have to do here. First, make sure the objects in your ArrayCollection that you're feeding to the grid are themselves [Bindable] or that at least the properties you want to display are [Bindable].

Secondly, I'm guessing that you want the stepper instances to also modify the values. You should read the documentation section entitled "Creating an item renderer and item editor" for an example of what you're trying to do.

verveguy