History | Log In     View a printable version of the current page.  
Issue Details (XML)

Key: SDK-12930
Type: Bug Bug
Status: Closed Closed
Resolution: Not a Bug
Priority: C C
Assignee: Gaurav Jain
Reporter: Graeme Harker
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Flex SDK

Logical operators not allowed in binding MXML expressions

Created: 10/06/07 05:25 AM   Updated: 10/17/07 03:02 AM
Component/s: Data Binding
Security Level: Public (All JIRA Users )

File Attachments: 1. File main.mxml (0.4 kb)


Severity: Incorrectly Functioning with Workaround
Reproducibility: Every Time
Discoverability: Medium
Found in Version: 2.0.1 English (Released) - 54321
Milestone:
Affected OS(s): All OS Platforms - All
Steps to Reproduce:
Steps to reproduce:
1. Enter a binding expression which includes a logical operator in MXML e.g.

<mx:Button enabled="{!this.model.user.authorized && this.creditCardForm.valid}"/>

 Actual Results:

The compiler raises the following error:-

"The entity name must immediately follow the '&' in the entity reference."
 
 Expected Results:

You would expect logical operators to be valid inside {} otherwise you'd expect the documentation at least to say they were not valid.
 
 Workaround (if any):
 
Wrap the logical expression in a function and call the function from the binding expression e.g.

 <mx:Button enabled="{this.logicalAnd(!this.model.user.authorized, this.creditCardForm.valid)}"/>
Language Found: English
Bugbase Id: none
Triaged: Yes
Regression: No
QA Owner: Gaurav Jain
Resolved by: Lauren Park
Participants: Gaurav Jain, Graeme Harker, Kristen Sindac, Lauren Park, Paul Reilly and Steve Breinberg
JDK: Sun 1.6.x


 All   Comments      Sort Order:
Kristen Sindac - [10/10/07 01:10 PM ]
this behavior existed since Flex 2.0.
Logical OR operator works in the same scenario. It's the use of '&&' that causes the compiler error.

Another workaround is to use '&amp;&amp;'

<mx:Button label="Test" enabled="{this.authorized &amp;&amp; this.cc}" />


Kristen Sindac - [10/10/07 01:11 PM ]
attaching test file

Steve Breinberg - [10/13/07 08:02 PM ]
This would be nice to fix, if it's easy.

Paul Reilly - [10/15/07 01:54 PM ]
This is not a bug, because the ampersands need to be replaced with &amp; due to the rules of XML.

Lauren Park - [10/16/07 06:24 PM ]
NAB

Graeme Harker - [10/17/07 03:02 AM ]
Then it's a bug in the documentation (see http://bugs.adobe.com/jira/browse/FLEXDOCS-225)