Max Titov IV @ TechSplice

The most beautiful music of all is the music of what happens.
  • Home
  • About
15 Jul 2011

MXML: “true && true” error

Stumbled across this strange error while doing some development.  I’ve needed to determine the enable function of a button based on two boolean conditions and as a result created the following bit of code:

<com:Component enabled=”{booleanA && booleanB}”/>

The compiler didn’t like what I’ve put together and threw the following error: The entity name must immediately follow the ‘&’ in the entity reference.

At first I litteraly thought that I’ve forgotten how to code and trivially tried a simple if statement in a <fx:Script> tag – that worked without a problem.  I’ve also tried to see if the or ”||” operator worked within the enabled attribute – which it did. My last thought before searching for a solution online was that the latest version of Adobe Flex had a bug in it.

Some of the solution that I’ve discovered are:

  • use ;&amp instead
  • use (booleanA) ? (booleanB):false
  • use !(!active1 || !active2)
I found the third option to be quite amusing though in general the root cause of the problem is the XML parsing of the MXML code.  Once you understand it should be straight forward.

Tags: coding, Flex, programming

This entry was posted on Friday, July 15th, 2011 at 2:39 pm and is filed under Flex. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.

« SAP: Configuring a Trust Relationship for SAP Assertion Tickets
SAP: EDI: Conversion of External Tax Rate »
  • Subscribe using FeedBurner
  • Cloud Data

    abap adobe animation basic beautiful builder camera code configuration contribution design development digital engineering fix flash Flex function images interesting lesson new paypal Photography php problem problems program programmer programming review sap SAP/ABAP sdk setup soap software solution story system tables transaction transports user video

    WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.

  • My Links

    • Cooking
    • Gallery
    • Resume
  • Online Tools

    • Airline Ticket Search
    • Estimate Shipping Cost [from US]
    • Link your Blog
  • Software Engineering Blogs

    • Adam Goucher
    • Joel on Software
    • The Third Bit
    • Wide Awake Developers
  • Categories

    • Everyday stuff
    • Flex
    • Photography
    • SAP/ABAP
    • Short Stories
    • Software Engineering
    • Web Development
  • Gallery

    Roy Tanck's Flickr Widget requires Flash Player 9 or better.

Max Titov IV @ TechSplice is proudly powered by WordPress
Design & code by Jonk
Entries (RSS) and Comments (RSS).