http://ofbiz.116.s1.nabble.com/Discussion-The-Form-Widget-use-when-attribute-tp201454p201456.html
The UEL throws an exception if an undefined value is used in an expression. I added an extension that allows you to specify a default value if one isn't found. So, it would look like this: ${partyIdfrom$string == ''}.
I tried to use the operator overload in BeanShell, but it threw a parse exception. I don't know what that is about.
> From: Scott Gray <
[hidden email]>
> Subject: Re: Discussion: The Form Widget use-when attribute
> To:
[hidden email]
> Date: Monday, May 4, 2009, 9:51 PM
> I don't mind either way, only one question, how does UEL
> handle undefined values e.g. (partyIdFrom == void) would we
> just do (partyIdFrom == null)?
>
> It's also worth mentioning that we never needed to use
> XML escaping for beanshell it was the one that supported the
> method I suggested for UEL.
>
> Regards
> Scott
>
> On 5/05/2009, at 4:33 PM, Adrian Crum wrote:
>
> >
> > Now that the UEL supports logical operator
> substitution
> (
http://docs.ofbiz.org/display/OFBTECH/Unified+Expression+Language+(JSR-245)+in+OFBiz#UnifiedExpressionLanguage%28JSR-245%29inOFBiz-OperatorSubstitutions)
> we have the ability to eliminate the clumsy XML escaping in
> the form widget use-when attribute. The problem is, the form
> widget evaluates the use-when attribute with BeanShell, not
> UEL.
> >
> > I would like to change the form widget to use UEL in
> use-when expression evaluations. The use-when attribute must
> evaluate to a boolean, and UEL is perfect for that. Plus,
> expression evaluation using UEL should execute faster than
> BeanShell.
> >
> > The potential downside is the chance there is a
> peculiar use-when expression that BeanShell can evaluate,
> but UEL can't. Those should be easy to find though.
> >
> > What do you think?
> >
> > -Adrian
> >
> >
> >
> >
> >