So is this intermittent or just never works in this configuration?  Are there 
console warning about not being able to detect changes?

Can you make a 20-line test case?


On 3/20/12 7:05 PM, "Uber_Nick" <nic...@gmail.com> wrote:






Nope, no difference with one vs two-way Bindings.  I discovered this problem 
with DropDownLists that had one-way bindings and used the change event to 
update the value vo.  I may have even been using selectedIndex instead of 
selectedItem-- don't remember.

The problem persisted after I tried two-way bindings.

Funny thing about it would be that the DropDownList would say "May" but the 
value of the VO would still be "February".  I'd then change the DropDownList to 
"June" and the VO would update to "June".  So the pointers were all referencing 
the right objects.

Even stranger-- changing the VO again externally would not update the 
DropDownList.  Something was going on with either the binding inside the 
DropDownList or the display/render function.  I would have blamed that 
component if it weren't also happening on Input Boxes.

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , Alex 
Harui <aharui@...> wrote:
>
> If you take off the two-way binding does it work?
>
>
> On 3/18/12 7:41 PM, "Uber_Nick" <nick14@...> wrote:
>
>
>
>
>
>
> I haven't tried explicitly re-setting the value manually or with 
> BindingUtils, but that's something I'll try now!  Should still be working 
> without that.
>
> I have a feeling the problem is actually in the display logic of the 
> component.  Like perhaps some built-in efficiency code to ignore binding 
> updates when it's hidden.  But I'll have to deep-dive a little further to 
> verify that.  It's more likely something I'm missing or doing wrong.
>
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>  
> <mailto:flexcoders%40yahoogroups.com> , yang chen <chenyang3@> wrote:
> >
> > Have you tried using binding util?
> >
> > > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>  
> > > <mailto:flexcoders%40yahoogroups.com>
> > > From: nick14@
> > > Date: Fri, 16 Mar 2012 20:08:47 +0000
> > > Subject: [flexcoders] Bindings on visual components being forgotten?  
> > > (Flex 3 -> 4.6)
> > >
> > > Seeing a strange, rare, issue after updating an app to 4.6.  I can't seem 
> > > to reproduce it in a dev environment, so I'll list out my issue and setup 
> > > to see if it sounds familiar to anyone.
> > >
> > > The problem:
> > > Visual components seem to occasionally "forget" the objects they're bound 
> > > to.  For instance, I have something like this:
> > >
> > > <s:DropDownList
> > >     id="cmbMonth"
> > >     dataProvider="{model.months}"
> > >     selectedItem="@{model.selectedMonth}"
> > > />
> > > <s:Label text="{model.selectedMonth}" />
> > >
> > > When the problem occurs, the "selectedMonth" in the label component is 
> > > correct, say, February.  But the DropDownList will display a blank.  Even 
> > > though the DropDownList contains all the months, meaning models.months is 
> > > bound correctly.
> > >
> > > I tried adding:
> > >     requireSelection="true"
> > >
> > > The addition changed the behavior.  No more blanks!  But now, instead of 
> > > blanks, selectedMonth is showing something random like "May".
> > >
> > > Background:
> > > App has been in production in various versions of Flex 3 for two years 
> > > without ever seeing this.  Upgrading to Flex 4 and swapping out some Halo 
> > > components with equivalent Spark ones, users, myself included, began 
> > > noticing this phenomenon.  I cannot seem to reproduce it in a reliable 
> > > fashion.  But I've gotten some feedback based on some attempted fixes 
> > > pushed out to users.
> > >
> > > Troubleshooting so far:
> > > Since it normally works, there's no super-obvious things missing, like an 
> > > uninitialized pointer, missing "Bindable" tag, accidental = assignment 
> > > instead of == comparison, etc.
> > >
> > > Also, we know the variable references are pointing to the correct place.  
> > > model.selectedMonth is showing up fine for a label just underneath the 
> > > dropdown.  model.months is being referenced just fine by the dropdown 
> > > itself.  It's just the display of model.selectedMonth in the dropdown.  
> > > Upon saving, the model.month property correctly propagates itself to the 
> > > DB, even when the dropdown is displaying the wrong value.  Switching 
> > > between one-way and two-way bindings don't seem to make a difference 
> > > either.  I noted above that I tried forcing requireSelection="true", 
> > > which does prevent the DropDownList from being blanked-out, but doesn't 
> > > force it to stay on the correct value.
> > >
> > > I thought it might be related to just the DropDownList component, but the 
> > > problem is also occurring on s:TextInput's text property.  Seems like 
> > > when it happens with the TextInput component (showing a blank value), 
> > > it's doing so for all the TextInput components.  I'm not so sure if it's 
> > > happening for all DropDownList elements, though.
> > >
> > >
> > > App setup:
> > > I have an mx:ViewStack attached to hide/show effects with two containers 
> > > inside (loggedOff/loggedOn), and a TabNavigator within that.  I think the 
> > > problems are only occurring after switching between states for the 
> > > ViewStack.  So after the components are hidden and come back.  I 
> > > remembered back to the Flex 2 ViewStack issue where bindings didn't 
> > > refresh, and added the old workaround to my code:
> > >     change="executeBindings(true)"
> > >
> > > This didn't fix it.  Anything else I can look at or try?  Anyone else 
> > > experience this before?  Any chance it's related to the framework instead 
> > > of my code?
> > >
> > >
> > >
> > > ------------------------------------
> > >
> > > --
> > > Flexcoders Mailing List
> > > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > > Alternative FAQ location: 
> > > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> > > Search Archives: 
> > > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups 
> > > Links
> > >
> > >
> > >
> >
>
>
>
>
>
>
> --
> Alex Harui
> Flex SDK Team
> Adobe Systems, Inc.
> http://blogs.adobe.com/aharui
>






--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui

Reply via email to