[flexcoders] Re: textInput databinding

2010-07-15 Thread valdhor
That would never have worked in Flex 3.

You are trying to use a binding expression in ActionScript code which will 
never work. Binding expressions like that will only work in MXML code.

--- In flexcoders@yahoogroups.com, mark.embrey mark.c.emb...@... wrote:

 Adobe, in their infinite wisdom, removed the data property from Spark
 TextInput.
 
 There is an example of assigning bindable data to a variable for use in
 the text value with Flex 4 at  Binding to an MXML TextInput control
 http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf6\
 9084-7d85.html   . I have tried to implement this technique but have
 still been unable to get it to work.
 
 When I specify the following:
 
  [Bindable]
  public var
 collection:String={myDataProvider.data.name.[0]};
 
 I simply receive the following in my textInput field:
 
 
  {myDataProvider.data.name.[0]}
 
 Does anyone have any ideas as to how I might specify a bindable variable
 such that it will display as desired ?
 
 (FWIW, this worked like a charm in Flex 3)
 
 
 thanks!
 
 MCE





Re: [flexcoders] Re: textInput databinding

2010-07-15 Thread Oleg Sivokon
That won't also work because there's a redundant dot before the bracket. ;)


Re: [flexcoders] Re: textInput databinding

2010-07-15 Thread Brendan Meutzner
Good catch Oleg :-)



On Thu, Jul 15, 2010 at 2:59 PM, Oleg Sivokon olegsivo...@gmail.com wrote:



 That won't also work because there's a redundant dot before the bracket. ;)

  



[flexcoders] Re: textInput databinding

2010-07-15 Thread mark.embrey
thanks for the suggestion, but that doesn't work

--- In flexcoders@yahoogroups.com, Brendan Meutzner bmeutz...@... wrote:

 [Bindable]
 public var collection:String = myDataProvider.data.name.[0];
 
 Does that work?
 
 
 
 
 On Thu, Jul 15, 2010 at 12:59 PM, mark.embrey mark.c.emb...@...wrote:
 
 
 
  Adobe, in their infinite wisdom, removed the data property from Spark
  TextInput.
 
  There is an example of assigning bindable data to a variable for use in the
  text value with Flex 4 at  Binding to an MXML TextInput 
  controlhttp://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d85.html.
   I have tried to implement this technique but have still been unable to get
  it to work.
 
  When I specify the following:
 
  [Bindable]
  public var collection:String={myDataProvider.data.name.[0]};
 
  I simply receive the following in my textInput field:
 
 
  {myDataProvider.data.name.[0]}
 
  Does anyone have any ideas as to how I might specify a bindable variable
  such that it will display as desired ?
 
  (FWIW, this worked like a charm in Flex 3)
 
 
  thanks!
 
  MCE
   
 





[flexcoders] Re: textInput databinding

2010-07-15 Thread mark.embrey
thanks for the suggestion, Oleg, but that didn't solve my problem... any other 
ideas?

thanks,

Mark


--- In flexcoders@yahoogroups.com, Oleg Sivokon olegsivo...@... wrote:

 That won't also work because there's a redundant dot before the bracket. ;)





[flexcoders] Re: textInput databinding

2010-07-15 Thread mark.embrey
Actually, as I understand it, I am using ActionScript to create a variable, but 
I am then binding that to an mxml component, no?

anyway, any ideas of how to do this?

thanks!

Mark


--- In flexcoders@yahoogroups.com, valdhor valdhorli...@... wrote:

 That would never have worked in Flex 3.
 
 You are trying to use a binding expression in ActionScript code which will 
 never work. Binding expressions like that will only work in MXML code.
 
 --- In flexcoders@yahoogroups.com, mark.embrey mark.c.embrey@ wrote:
 
  Adobe, in their infinite wisdom, removed the data property from Spark
  TextInput.
  
  There is an example of assigning bindable data to a variable for use in
  the text value with Flex 4 at  Binding to an MXML TextInput control
  http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf6\
  9084-7d85.html   . I have tried to implement this technique but have
  still been unable to get it to work.
  
  When I specify the following:
  
   [Bindable]
   public var
  collection:String={myDataProvider.data.name.[0]};
  
  I simply receive the following in my textInput field:
  
  
   {myDataProvider.data.name.[0]}
  
  Does anyone have any ideas as to how I might specify a bindable variable
  such that it will display as desired ?
  
  (FWIW, this worked like a charm in Flex 3)
  
  
  thanks!
  
  MCE
 





Re: [flexcoders] Re: textInput databinding

2010-07-15 Thread Brendan Meutzner
Mark,

What isn't working... the binding?  What are you getting for your TextInput
text value with the suggestions from Oleg and myself.  You definitely
shouldn't be getting the same issue as you first posted about with these
updates, so where is it falling short now?


Brendan



On Thu, Jul 15, 2010 at 4:39 PM, mark.embrey mark.c.emb...@gmail.comwrote:



 thanks for the suggestion, Oleg, but that didn't solve my problem... any
 other ideas?

 thanks,

 Mark


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Oleg
 Sivokon olegsivo...@... wrote:
 
  That won't also work because there's a redundant dot before the bracket.
 ;)
 

  



Re: [flexcoders] Re: textInput databinding

2010-07-15 Thread Brendan Meutzner
Why wouldn't you just do this:

TextInput text={myDataProvider.data.name[0]} /



On Thu, Jul 15, 2010 at 4:38 PM, mark.embrey mark.c.emb...@gmail.comwrote:



 Actually, as I understand it, I am using ActionScript to create a variable,
 but I am then binding that to an mxml component, no?

 anyway, any ideas of how to do this?

 thanks!

 Mark


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 valdhor valdhorli...@... wrote:
 
  That would never have worked in Flex 3.
 
  You are trying to use a binding expression in ActionScript code which
 will never work. Binding expressions like that will only work in MXML code.
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 mark.embrey mark.c.embrey@ wrote:
  
   Adobe, in their infinite wisdom, removed the data property from Spark
   TextInput.
  
   There is an example of assigning bindable data to a variable for use in
   the text value with Flex 4 at Binding to an MXML TextInput control
   
 http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf6\
  http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf6
  9084-7d85.html . I have tried to implement this technique but have
   still been unable to get it to work.
  
   When I specify the following:
  
   [Bindable]
   public var
   collection:String={myDataProvider.data.name.[0]};
  
   I simply receive the following in my textInput field:
  
  
   {myDataProvider.data.name.[0]}
  
   Does anyone have any ideas as to how I might specify a bindable
 variable
   such that it will display as desired ?
  
   (FWIW, this worked like a charm in Flex 3)
  
  
   thanks!
  
   MCE
  
 

  



Re: [flexcoders] Re: textInput databinding

2010-07-15 Thread Oleg Sivokon
Hi, I think square brackets may be an obstacle here. I think they didn't
always work, or maybe they don't work even now? Anyways, if that's an array
collection, you'd better use getItemAt() and if that's an XML or XMLList,
you'd be better of with the XML / XMLList methods corresponding to what you
wanted to do (like child(), children() and so on).
Also, data is often times used in the framework for instances of Object,
which is not bindable because it is not an IEvetnDispatcher. Check that
option too.


[flexcoders] Re: textInput databinding

2010-07-15 Thread mark.embrey
Brendan,

I've tried this every which way I can imagine... variable assignment within 
quotes, without quotes, within and without braces, and with and without dot 
notation before item selection.

Going back to the beginning, I'm wondering if there might be another way to get 
the value I want into a variable. Specifically, I'm wondering if I can bind the 
value I want to some other type variable and then copy/change/cast it to a 
String variable.

Any other ideas/suggestions?

thanks, Mark

--- In flexcoders@yahoogroups.com, Brendan Meutzner bmeutz...@... wrote:

 Mark,
 
 What isn't working... the binding?  What are you getting for your TextInput
 text value with the suggestions from Oleg and myself.  You definitely
 shouldn't be getting the same issue as you first posted about with these
 updates, so where is it falling short now?
 
 
 Brendan
 
 
 
 On Thu, Jul 15, 2010 at 4:39 PM, mark.embrey mark.c.emb...@...wrote:
 
 
 
  thanks for the suggestion, Oleg, but that didn't solve my problem... any
  other ideas?
 
  thanks,
 
  Mark
 
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Oleg
  Sivokon olegsivokon@ wrote:
  
   That won't also work because there's a redundant dot before the bracket.
  ;)
  
 
   
 





[flexcoders] Re: textInput databinding

2010-07-15 Thread mark.embrey
Brendan,

Actually, that's where I started, as it worked in Flex 3. The only properties 
of Spark TextInput are:

 s:TextInput
Properties
widthInChars=Calculated default
  



the properties of Halo TextInput are:

mx:TextInput
Properties
condenseWhite=false|true
data=undefined
displayAsPassword=false|true
editable=true|false
horizontalScrollPosition=0
htmlText=
imeMode=null
length=0
listData=null
maxChars=0
restrict=null
selectionBeginIndex=0
selectionEndIndex=0
text=
textHeight=0
textWidth=0



... quite a change, huh!?

Mark

--- In flexcoders@yahoogroups.com, Brendan Meutzner bmeutz...@... wrote:

 Why wouldn't you just do this:
 
 TextInput text={myDataProvider.data.name[0]} /
 
 
 
 On Thu, Jul 15, 2010 at 4:38 PM, mark.embrey mark.c.emb...@...wrote:
 
 




[flexcoders] Re: textInput databinding

2010-07-15 Thread mark.embrey
Bingo! that did it!

the final solution, in my example, is:

text={myDataProvider.getItemAt(0).name}


thanks for your help, Oleg, and to everyone who contributed to the conversation.

best,

Mark


--- In flexcoders@yahoogroups.com, Oleg Sivokon olegsivo...@... wrote:

 Hi, I think square brackets may be an obstacle here. I think they didn't
 always work, or maybe they don't work even now? Anyways, if that's an array
 collection, you'd better use getItemAt() and if that's an XML or XMLList,
 you'd be better of with the XML / XMLList methods corresponding to what you
 wanted to do (like child(), children() and so on).
 Also, data is often times used in the framework for instances of Object,
 which is not bindable because it is not an IEvetnDispatcher. Check that
 option too.





Re: [flexcoders] Re: textInput databinding

2010-07-15 Thread Brendan Meutzner
Mark, glad you got it worked out.

However, you need to look at the fact the Spark TextInput extends from
SkinnableTextBase which contains the properties you'd expect.


Brendan


On Thu, Jul 15, 2010 at 5:28 PM, mark.embrey mark.c.emb...@gmail.comwrote:



 Bingo! that did it!

 the final solution, in my example, is:

 text={myDataProvider.getItemAt(0).name}

 thanks for your help, Oleg, and to everyone who contributed to the
 conversation.

 best,

 Mark


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Oleg
 Sivokon olegsivo...@... wrote:
 
  Hi, I think square brackets may be an obstacle here. I think they didn't
  always work, or maybe they don't work even now? Anyways, if that's an
 array
  collection, you'd better use getItemAt() and if that's an XML or XMLList,
  you'd be better of with the XML / XMLList methods corresponding to what
 you
  wanted to do (like child(), children() and so on).
  Also, data is often times used in the framework for instances of
 Object,
  which is not bindable because it is not an IEvetnDispatcher. Check that
  option too.