Hi Marco,

Behavior of VE is quite peculiar:

Your sample code will be executed on the bean in target VM. To prevent it
from being executed on the bean in the target VM you could use following:

if (false) {
} else {
  ulcLabel1 = null;
}

However there is a catch:

Suppose you created a bean (a class extending ULCWidget) and used that
widget in another visual class in that case the code under
!Beans.isDesignTime() won't be executed.

But, the code suppressed using "if (false)" will be executed.

Conclusion:

!Beans.isDesignTime() works when the bean is used in another bean. It does
not work when the bean is being edited.

"if (false)" works when you are editing the class. It does not work when the
bean is being used in another bean.

I hope this helps.

Thanks and regards,

Janak

>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] Behalf Of
>[EMAIL PROTECTED]
>Sent: Thursday, August 10, 2006 12:17 PM
>To: [EMAIL PROTECTED]
>Subject: [ULC-developer] Beans.isDesignTime()
>
>
>
>Hi all,
>I tryed the methode Beans.isDesignTime() with this little
>example:
>
>      private ULCLabel getUlcLabel1() {
>            if (ulcLabel1 == null) {
>                  ulcLabel1 = new ULCLabel();
>                  ulcLabel1.setText("ULCLabel");
>                  if(!Beans.isDesignTime()){
>                        ulcLabel1 = null;
>                  }
>            }
>            return ulcLabel1;
>      }
>
>Unfortunately ulc-ve 5.0.1 translate the code inside this methode
>anyway.
>Can anybody explain me why and in which cases this method works?
>Thx
>Marco
>
>
>_______________________________________________
>ULC-developer mailing list
>[email protected]
>http://lists.canoo.com/mailman/listinfo/ulc-developer

_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer

Reply via email to