I have a component for my infoWindow set up to only show when a particular field has data in it. This has worked quite well for me to 'close the gap' of blank lines when I don't have data in a particular field.
I now have an instance where I only want to show "field3" if "field1" and "field2" are both blank. I tried combining the two, but I'm getting an error. I don't know if I can't do this, or if I've just got a syntax problem.
<mx:Component className="MyInfoWindowRenderer">
<mx:VBox verticalGap="-5" height="100%">
<infoClasses:InfoWindowLabel styleName="balloonTitle" text="{data.FACILITY}" width="100%"/>
<mx:Label text="{data.ADDRESS}" />
<mx:Label text="{data.CITY}, {data.STATE}, {data.ZIP}"/>
<mx:Label includeInLayout="{data.PHONE1 != ''? true:false}"
visible="{data.PHONE1 != ''? true:false}" text="Phone: {data.PHONE1}"/>
<mx:Label includeInLayout="{data.PHONE2 != ''? true:false}"
visible="{data.PHONE2 != ''? true:false}"
text="Phone: {data.PHONE2}"/>
<!-- this is the section that is failing ... -->
<mx:Label includeInLayout="{(data.PHONE1 != ''? true:false) && (data.PHONE2 !== ''? true:false)}"
visible="{(data.PHONE1 != ''? true:false) && (data.PHONE2 !== ''? true:false)}"
text="Phone: {data.PHONE3_FB}"/>
<mx:Label includeInLayout="{data.DAYS != ''? true:false}"
visible="{data.DAYS != ''? true:false}"
text="---------------------------------------" />
<mx:Label includeInLayout="{data.DAYS != ''? true:false}"
visible="{data.DAYS != ''? true:false}"
text="{data.DAYS}"/>
<mx:Label includeInLayout="{data.HOURS != ''? true:false}"
visible="{data.HOURS != ''? true:false}"
text="{data.HOURS}"/>
<mx:Label includeInLayout="{data.CERTIFICATION != ''? true:false}"
visible="{data.CERTIFICATION != ''? true:false}" text="---------------------------------------" />
<mx:TextArea width="100%" height="60" includeInLayout="{data.CERTIFICATION != ''? true:false}"
visible="{data.CERTIFICATION != ''? true:false}"
text="{data.CERTIFICATION}"/>
<mx:Label includeInLayout="{data.LOC_CODE != 'CENT'? false:true}"
visible = "{data.LOC_CODE != 'CENT'? false:true}"
text="** Location Approximate **"/>
</mx:VBox>
</mx:Component>