PDA

View Full Version : multiple boolean checks in databinding


springframework
02-20-2008, 12:27 AM
i need to code something that does this

enabled="{!Boolean(list.selectedIndex == -1 && list2.selectedIndex == -1)}"


i need the button only enabled when both lists have a selection.

my code gives an error though:
The entity name must immediately follow the '&' in the entity reference.


Vancouver Actionscript 3.0 (http://www.jessecouch.com)

springframework
02-20-2008, 12:36 AM
i searched on Yahoo and found the answer


either do:

Boolean(list.selectedIndex >= 0) && Boolean(list2.selectedIndex >= 0)

or switch your && statements to similar || statements


Vancouver Actionscript 3.0 (http://www.jessecouch.com)

springframework
02-20-2008, 06:06 PM
Also the "<" character isn't allowed

"<" checks must be converted to similar ">=" checks



Jesse Couch Actionscript 3.0 (http://www.jessecouch.com)

dr_zeus
02-20-2008, 08:00 PM
Yeah, since it's XML, you have to encode certain entities to make it valid.