I'm in trouble with valuation of conditional expression in Flex
.
Let me explain.
I have this :
<s:Label text="SomeTextLawyer" includeInLayout="{Session.isLawyer()}"
visible="{Session.isLawyer()}"/>
<s:Label text="SomeTextDoctor" includeInLayout="{Session.isDoctor()}"
visible="{Session.isDoctor()}"/>
This Session object is defined as below :
public class Session extends Singleton
{
[Bindable]
private static var user:User;
[...]
public static function isDoctor():Boolean {
return Session.user.type == model.type.DOCTOR;
}
public static function isLaywer():Boolean {
return Session.user.type == model.type.LAWYER;
}
}
I have a mechanism that change the user, so my user can be first a doctor and then a lawyer. Problem is that my labels keep their first valuation. If I connect as a doctor first, I still have the doctor label displayed if I change my user as a lawyer. And vice versa...
On the AS code, my user is the good kind of user, but not on my mxml
files... So only the displayed part doesn't see the user switching.
Any idea ?
Thank you in advance !