Hi,

I don't know if this helps, but what I've done in the past is to bind the
VO and then if I need to update it I had the same problem you were talking
about.  I would change the value, but the VO wouldn't change as the
binging goes from the VO to the component, not the other way around.  My
little work around was to have a function similar to this (assuming the VO
is called 'voToChange' of type 'VO')

private function update():void
{
     var holderVO:VO = voToChange;
     voToChange = new VO();
     voToChange = holderVO;
}

This then changes the VO so the change will go back to the component. 
Alternatively if you want to set something on the VO you could change the
function to somethign like

private function setSomthing(something:Object):void
{
    voToChange.propertyToChange = something;
    //Call the update function
    update();
}

I hope I haven't completely misunderstood what you are having problems with.

Luck,

Tim

> I understand that. I know how to bind some class. Problem is, that if
> I Bind whole VO to one of my components, if I change something in the
> VO (only one var) than nothing will change. I don't want to bind all
> the properties separately.
>
> I can make one example for drawing line:
>
>
> [Bindable]
> public class LineVO
> {
>  public var startX:Number;
>  public var startY:Number;
>  public var endX:Number;
>  public var endY:Number;
> }
>
> Than I have one component to draw the line with LineVO.
>
> var linevo:LineVO=new LineVO();
> linevo.startX=0;
> linevo.startY=0;
> linevo.endX=20;
> linevo.endY=30;
>
> var newLine:Line=new Line();
> newLine.vo=linevo;
> addChild(newLine);
>
> I only want to bind the whole linevo, not the properties.
>
> Now if i change some properties like startX or startY, in the line
> should be triggered one function that I bind to.
>
> It is working for me if I bind the every propertie by itself, like this:
>
> BindingUtils.bindProperty(newLine,"onChange",linevo,"startX");
>
> That is not O.K., because than I have to bind everything manually.
>
> I hope that now somebody can help me.
>
> Thanks,
> Toni
>
>
>
> --- In flexcoders@yahoogroups.com, "madflexcoder" <[EMAIL PROTECTED]>
> wrote:
>>
>> Put your [Bindable] tag on top of your class and it will make the
>> entire class bindable.
>>
>> [Bindable]
>> public class MyVo
>> {
>>
>> }
>>
>>
>> brian..
>>
>>
>>
>>
>> --- In flexcoders@yahoogroups.com, "toniabc" <toniabc@> wrote:
>> >
>> > Hi!
>> >
>> > I have one problem.
>> >
>> > I have Value Object that I want to Bind to my custom made component. I
>> > have no problems to bind every single value from VO to component. And
>> > if I change something in the VO, that will be changed.
>> >
>> > But I want to Bind the whole VO (at once, not every value by itself).
>> > So that I can override the whole VO and changes will be automatically
>> > trigger the update function in my component. And if I remove the VO,
>> > than I want to remove my component from view.
>> >
>> > Thank you,
>> > Toni P.
>> >
>>
>
>
>


Reply via email to