Re: [flexcoders] Re: Bindings on visual components being forgotten? (Flex 3 - 4.6)

2012-03-22 Thread Richard Albrecht
Thanks, that did work as far as zooming, but... 

When you zoom, you don't have the ability to pan and though the font gets 
bigger, the columns in the grid do not scale, so the numbers get cut off. Could 
this be because I'm using the mx.datagrid? I haven't figured out the 
s.datagrid. 


Thanks Rich 

- Original Message -

From: Grant Davies gdav...@bluetubeinteractive.com 
To: flexcoders@yahoogroups.com 
Sent: Tuesday, March 20, 2012 9:44:16 PM 
Subject: RE: [flexcoders] Re: Bindings on visual components being forgotten? 
(Flex 3 - 4.6) 







HI Rich.. 

1) you’d have to have an event handler listen for the pinch gesture and then 
scale your grid based on how much you want it to scale/shrink 

http://paultrani.com/2011/02/touch-events-and-gestures-on-mobile/ ( look at 
pinch/zoom) 


2) you there are a few methods to handle the DPI variation, we generally target 
the primary device and set our application dpi to that ( for exampl! e I’m 
building an app for a 7” android right now and have my DPI set to 166), there 
is quite a good article here on handling DPI 

http://opensource.adobe.com/wiki/display/flexsdk/DPI+Auto+Scaling+for+Density+Independent+Mobile+Apps
 

Cheers 
Grant 



--- In flexcoders@yahoogroups.com , Richard Albrecht  Rich@...  wrote: 
 
 Hi, 
 
 First time writing to a group in many years. I'm basically a noob with Flash 
 Builder 4.5 and flex.  
 I right now have 2 questions: 
 
 1. I ha ve an engineering app that I have running in the desktop. So the next 
 step is take it mobile. Why don't the screens have the ability to zoom with a 
 pinch? I have a screen that has a large datagrid and I want to make the text 
 bigger, but then part of the grid moves off screen and you can't scroll over 
 to see the hidden data. I thought this was available in all mobile apps. 
 
 2. The question on Scaling. What is the best way. What DPI should I have it 
 set to. We also want a tablet version. Is there any good docs on the best way 
 to accomplish this. Is using states a way. This one is I'm sure fairly 
 complicated. 
 
 Thanks and I hope I get faster responses here than on Adobe's forums. 
 
 Thanks 
 
 
 Rich 
 



 


Re: [flexcoders] Re: Bindings on visual components being forgotten? (Flex 3 - 4.6)

2012-03-21 Thread Alex Harui
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 +
   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 

[flexcoders] Re: Bindings on visual components being forgotten? (Flex 3 - 4.6)

2012-03-21 Thread Uber_Nick
It's been happening with all configurations, but intermittently.  I've had 0 
success reproducing it at will, even though myself and multiple users have come 
across it on non-dev environments.

My troubleshooting has mostly been releasing things I think *might* have an 
impact, then asking users to send screen caps if they come across the issue 
again.  It seems to be occurring regularly, although a hundred runs of the code 
below haven't shown it on my dev box.  So I can't tell if there are any console 
messages at runtime.  There are no compile-time warnings, and there weren't any 
of these issues when compiling with Flex 3 (swapping Spark components for Halo).

Below is an 80-line, 4-file example I've been trying to use to attempt to 
reproduce the problem.  I have not been successful reproducing it, but the 
structure and components used below closely resembled the full app.  Only thing 
missing is that the full app has a set of Mate controllers and a bunch of AMF 
remote calls.  Nothing those touch seem to be affected though.

Since this problem is so hard to reproduce, I don't expect a resolution here.  
Just seeing if I'm doing something glaringly wrong or if the problems sound 
familiar to other developers.

?xml version=1.0 encoding=utf-8?
s:Application xmlns:fx=http://ns.adobe.com/mxml/2009; 
   xmlns:s=library://ns.adobe.com/flex/spark 
   xmlns:mx=library://ns.adobe.com/flex/mx 
minWidth=955 minHeight=600 xmlns:local=*


fx:Declarations
local:MyModel id=model /
/fx:Declarations

mx:ViewStack selectedIndex={model.viewStackIndex}
s:NavigatorContent
showEffect=Fade
hideEffect=Fade

local:Page1 model={model} /
/s:NavigatorContent
s:NavigatorContent
showEffect=Fade
hideEffect=Fade

local:Page2 model={model}/
/s:NavigatorContent
/mx:ViewStack
/s:Application

// MyModel.as
package
{
[Bindable]
public class MyModel
{
public var viewStackIndex:Number=0;

public var one:String=one;
public var two:String=two;
public var three:String=three;
public var four:String=four;
}
}

// Page1.mxml
?xml version=1.0 encoding=utf-8?
s:Group xmlns:fx=http://ns.adobe.com/mxml/2009; 
 xmlns:s=library://ns.adobe.com/flex/spark 
 xmlns:mx=library://ns.adobe.com/flex/mx width=400 
height=300 xmlns:local=*
fx:Declarations
local:MyModel id=model /
/fx:Declarations  
s:Button label=Forward x=150 y=100 click=model.viewStackIndex = 
(model.viewStackIndex == 0) ? 1 : 0;/
/s:Group

// Page2.mxml
?xml version=1.0 encoding=utf-8?
s:Group xmlns:fx=http://ns.adobe.com/mxml/2009; 
 xmlns:s=library://ns.adobe.com/flex/spark 
 xmlns:mx=library://ns.adobe.com/flex/mx width=400 
height=300 xmlns:local=*
 
fx:Script
![CDATA[
import mx.collections.ArrayList;
]]
/fx:Script

fx:Declarations
local:MyModel id=model /
/fx:Declarations
s:TextInput x=10 y=10 text={model.one} /
s:CheckBox x=250 y=10 label={model.two} 
selected={model.two=='two'} visible={model.two=='two'} /
s:Button label=Back x=150 y=100 click=model.viewStackIndex = 
(model.viewStackIndex == 0) ? 1 : 0;/
s:Label x=10 y=200 text={model.three} /
s:DropDownList x=250 y=200  selectedItem={model.four} 
dataProvider={new ArrayList(['bar', 'four', 'bar', 'bar', 'bar', 'bar'])} /
/s:Group




--- In flexcoders@yahoogroups.com, Alex Harui aharui@... wrote:

 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 nick14@... 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.  

Re: [flexcoders] Re: Bindings on visual components being forgotten? (Flex 3 - 4.6)

2012-03-21 Thread Alex Harui
I see duplicate dataprovider entries which might confuse which selectedIndex to 
use.

They key is to make sure binding events are getting dispatched.  You might want 
to add a logging facility to track changes and events and some other properties.


On 3/21/12 8:09 AM, Uber_Nick nic...@gmail.com wrote:






It's been happening with all configurations, but intermittently.  I've had 0 
success reproducing it at will, even though myself and multiple users have come 
across it on non-dev environments.

My troubleshooting has mostly been releasing things I think *might* have an 
impact, then asking users to send screen caps if they come across the issue 
again.  It seems to be occurring regularly, although a hundred runs of the code 
below haven't shown it on my dev box.  So I can't tell if there are any console 
messages at runtime.  There are no compile-time warnings, and there weren't any 
of these issues when compiling with Flex 3 (swapping Spark components for Halo).

Below is an 80-line, 4-file example I've been trying to use to attempt to 
reproduce the problem.  I have not been successful reproducing it, but the 
structure and components used below closely resembled the full app.  Only thing 
missing is that the full app has a set of Mate controllers and a bunch of AMF 
remote calls.  Nothing those touch seem to be affected though.

Since this problem is so hard to reproduce, I don't expect a resolution here.  
Just seeing if I'm doing something glaringly wrong or if the problems sound 
familiar to other developers.

?xml version=1.0 encoding=utf-8?
s:Application xmlns:fx=http://ns.adobe.com/mxml/2009;
   xmlns:s=library://ns.adobe.com/flex/spark
   xmlns:mx=library://ns.adobe.com/flex/mx minWidth=955 minHeight=600 
xmlns:local=*


fx:Declarations
local:MyModel id=model /
/fx:Declarations

mx:ViewStack selectedIndex={model.viewStackIndex}
s:NavigatorContent
showEffect=Fade
hideEffect=Fade

local:Page1 model={model} /
/s:NavigatorContent
s:NavigatorContent
showEffect=Fade
hideEffect=Fade

local:Page2 model={model}/
/s:NavigatorContent
/mx:ViewStack
/s:Application

// MyModel.as
package
{
[Bindable]
public class MyModel
{
public var viewStackIndex:Number=0;

public var one:String=one;
public var two:String=two;
public var three:String=three;
public var four:String=four;
}
}

// Page1.mxml
?xml version=1.0 encoding=utf-8?
s:Group xmlns:fx=http://ns.adobe.com/mxml/2009;
 xmlns:s=library://ns.adobe.com/flex/spark
 xmlns:mx=library://ns.adobe.com/flex/mx width=400 height=300 
xmlns:local=*
fx:Declarations
local:MyModel id=model /
/fx:Declarations
s:Button label=Forward x=150 y=100 click=model.viewStackIndex = 
(model.viewStackIndex == 0) ? 1 : 0;/
/s:Group

// Page2.mxml
?xml version=1.0 encoding=utf-8?
s:Group xmlns:fx=http://ns.adobe.com/mxml/2009;
 xmlns:s=library://ns.adobe.com/flex/spark
 xmlns:mx=library://ns.adobe.com/flex/mx width=400 height=300 
xmlns:local=*
 
fx:Script
![CDATA[
import mx.collections.ArrayList;
]]
/fx:Script

fx:Declarations
local:MyModel id=model /
/fx:Declarations
s:TextInput x=10 y=10 text={model.one} /
s:CheckBox x=250 y=10 label={model.two} selected={model.two=='two'} 
visible={model.two=='two'} /
s:Button label=Back x=150 y=100 click=model.viewStackIndex = 
(model.viewStackIndex == 0) ? 1 : 0;/
s:Label x=10 y=200 text={model.three} /
s:DropDownList x=250 y=200  selectedItem={model.four} dataProvider={new 
ArrayList(['bar', 'four', 'bar', 'bar', 'bar', 'bar'])} /
/s:Group

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex 
Harui aharui@... wrote:

 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 nick14@... 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  
 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 

[flexcoders] Re: Bindings on visual components being forgotten? (Flex 3 - 4.6)

2012-03-20 Thread Uber_Nick
I have to refute the idea that bindings have ever been problematic.

The way bindings work are very, very simple.  When a variable is declared 
bindable, an event dispatched at the setter.  And binding calling the getter 
then listens for that event, and re-calls the getter when triggered.  
BindingUtils functions do the same thing.

After working and training with various versions of Flex for 6 years, the 
problems I've seen people have with bindings is that they're changing a 
non-binding object somewhere in the chain.  It's usually pretty easy to fix-- 
just make the unbound object bindable.  Have you seen any other specific issues?

I'm pretty sure here that the problem isn't in the Bindings themselves.  My 
best guess is either something stupidly obvious in my code (like declaring 
something as null instead of null-checking it), or more obscure like an of 
optimization in the spark component that's skipping update() cycles when it 
thinks the object isn't visible.  But without being able to reproduce the issue 
with any kind of frequency, I can't be sure of that.  Was mostly sending this 
out to see if anyone else had seen the issue.  Since they haven't, I'm going to 
assume it's my code.

I much appreciate your suggestions and response, but don't make unqualified 
statements blaming the core API!


--- In flexcoders@yahoogroups.com, yang chen chenyang3@... wrote:

 
 MXML binding has always been problematic and very often you'll lose the 
 binding at some point. For me binding utils has been much more reliable.
 Regards,Yang
 
  To: flexcoders@yahoogroups.com
  From: nick14@...
  Date: Mon, 19 Mar 2012 02:41:27 +
  Subject: [flexcoders] Re: Bindings on visual components being forgotten? 
  (Flex 3 - 4.6)
  
  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, yang chen chenyang3@ wrote:
  
   Have you tried using binding util?
   
To: flexcoders@yahoogroups.com
From: nick14@
Date: Fri, 16 Mar 2012 20:08:47 +
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

[flexcoders] Re: Bindings on visual components being forgotten? (Flex 3 - 4.6)

2012-03-20 Thread Uber_Nick
Hi Rich, I'd answer your question if I could, but haven't worked much with Flex 
on mobile devices.

Re-post your question as a new thread and hopefully a few others will see it.  
You've accidentally put it buried down the thread chain of a fairly obscure 
question :-)

--- In flexcoders@yahoogroups.com, Richard Albrecht Rich@... wrote:

 Hi,
 
 First time writing to a group in many years. I'm basically a noob with Flash 
 Builder 4.5 and flex.
 
 I right now have 2 questions:
 
 1. I have an engineering app that I have running in the desktop. So the next 
 step is take it mobile. Why don't the screens have the ability to zoom with a 
 pinch? I have a screen that has a large datagrid and I want to make the text 
 bigger, but then part of the grid moves off screen and you can't scroll over 
 to see the hidden data. I thought this was available in all mobile apps.
 
 2. The question on Scaling. What is the best way. What DPI should I have it 
 set to. We also want a tablet version. Is there any good docs on the best way 
 to accomplish this. Is using states a way. This one is I'm sure fairly 
 complicated.
 
 Thanks and I hope I get faster responses here than on Adobe's forums.
 
 Thanks
 
 
 Rich





[flexcoders] Re: Bindings on visual components being forgotten? (Flex 3 - 4.6)

2012-03-20 Thread Uber_Nick
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, 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 , 
 yang chen chenyang3@ wrote:
 
  Have you tried using binding util?
 
   To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
   From: nick14@
   Date: Fri, 16 Mar 2012 20:08:47 +
   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 

RE: [flexcoders] Re: Bindings on visual components being forgotten? (Flex 3 - 4.6)

2012-03-19 Thread yang chen

MXML binding has always been problematic and very often you'll lose the binding 
at some point. For me binding utils has been much more reliable.
Regards,Yang

 To: flexcoders@yahoogroups.com
 From: nic...@gmail.com
 Date: Mon, 19 Mar 2012 02:41:27 +
 Subject: [flexcoders] Re: Bindings on visual components being forgotten? 
 (Flex 3 - 4.6)
 
 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, yang chen chenyang3@... wrote:
 
  Have you tried using binding util?
  
   To: flexcoders@yahoogroups.com
   From: nick14@...
   Date: Fri, 16 Mar 2012 20:08:47 +
   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
   
   
  
 
 
 
 
 
 
 
 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Alternative FAQ location

[flexcoders] Re: Bindings on visual components being forgotten? (Flex 3 - 4.6)

2012-03-18 Thread Uber_Nick
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, yang chen chenyang3@... wrote:

 Have you tried using binding util?
 
  To: flexcoders@yahoogroups.com
  From: nick14@...
  Date: Fri, 16 Mar 2012 20:08:47 +
  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
  
  
 





Re: [flexcoders] Re: Bindings on visual components being forgotten? (Flex 3 - 4.6)

2012-03-18 Thread Alex Harui
If you take off the two-way binding does it work?


On 3/18/12 7:41 PM, Uber_Nick nic...@gmail.com 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 , yang 
chen chenyang3@... wrote:

 Have you tried using binding util?

  To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
  From: nick14@...
  Date: Fri, 16 Mar 2012 20:08:47 +
  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