Bummer, this looks like a bug. I'll go ahead and file it.

As a workaround you should be able to specify the whole value as a binding
expression and just do the string concatenation yourself:

E.g., 
<mx:Label text="{'label: ' + l.selectedItem.label + ', data \'' +
l.selectedItem.data + '\', index ' + l.selectedIndex}" />


Matt

-----Original Message-----
From: Dirk Eismann [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 01, 2004 8:52 AM
To: FLEXCODERS (E-Mail)
Subject: [flexcoders] Single quotes affect data binding

I have some weird effects when mixing static data with dynamic content.
I have some dynamic data that has to have quotes around it.
Unfortunately, placing quotes around a data binding expression is not
working properly and bindings no longer get executed correctly. There
seems also no way to "protect" a single quote from parsing by writing \'
instead. Sample below.

Dirk.

<!-- begin mxml -->
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";>

� <mx:Script>
��� <![CDATA[
����� var dp = [{label: "One", data: "100"},{label: "Two", data:
"200"}];
��� ]]>
� </mx:Script>
����� 
� <mx:List dataProvider="{dp}" id="l" />
� 
� <!-- doesn't work for the last binding -->
� <mx:Label text="label: {l.selectedItem.label}, data
'{l.selectedItem.data}', index {l.selectedIndex}" />

� <!-- doesn't work for the first binding -->
� <mx:Label text="label: '{l.selectedItem.label}', data
{l.selectedItem.data}, index {l.selectedIndex}" />

� <!-- doesn't work for the first and the last binding -->
� <mx:Label text="label: '{l.selectedItem.label}', data
'{l.selectedItem.data}', index {l.selectedIndex}" />

� <!-- works on all(!!) bindings -->
� <mx:Label text="label: {l.selectedItem.label}, data
'{l.selectedItem.data}', index '{l.selectedIndex}'" />

</mx:Application>
<!-- end mxml -->



Yahoo! Groups Sponsor
ADVERTISEMENT





Yahoo! Groups Links
* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
� 
* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
� 
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


Reply via email to