In Flex, we often use braces {} for Data Binding. However, if we perform logical operations and condition operations within {}, we use the & and <symbol,
However, an error is reported when you use this method. This is because the & and <characters are occupied by XML and cannot be used in the bound expression. We can use & amp;
Replace &, use & lt; instead <
The following is an example:
[HTML]View
Plaincopy
- <? 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">
- <S: layout>
- <S: verticallayout/>
- </S: layout>
- <FX: declarations>
- </FX: declarations>
- <S: textinput id = "ti_src"/>
- <Mx: Text id = "ti_des" text = "{ti_src.text! = ''& Amp; ti_src.text! = '1 '? Ti_src.text: 'A'} "/>
- </S: Application>
Reprinted: http://blog.csdn.net/vipliyaohua/article/details/6636794