"Logical AND" with flex binding in mxml
Initially there was a single parameter binding which set the button enabled, eg:
The business requirements changed and we need to have a global setting as well as a user setting, so now the setting had to be globally enabled and the user had to have access to it.
My 1st attempt was this:
However, this gave the following error:
The entity name must immediately follow the '&' in the entity reference.
This you may recognise as an XML formatting error. After a quick google I came across a bug in the adobe bug tracker related to this (BTW I love that this is now open and searchable) which explained the workaround. XML escape the characters - which feels ugly when writing code, but it does make sense.
So the code now becomes:
I also came across another way of handling it using the ternary operator which is very clever but I think it is even less readable than the escaped XML characters.
Cheers, Mark




There are no comments for this entry.
[Add Comment]