--- On Mon, 2/8/10, Bilgin Ibryam <bibr...@gmail.com> wrote:

> From: Bilgin Ibryam <bibr...@gmail.com>
> Subject: Re: svn commit: r906526 - 
> /ofbiz/trunk/framework/example/widget/example/FormWidgetExampleForms.xml
> To: dev@ofbiz.apache.org
> Date: Monday, February 8, 2010, 2:48 AM
> Adrian Crum wrote:
> > What if the labels are used somewhere other than a
> Freemarker template? We should not put Freemarker
> expressions in UI labels.
> >   
> I agree.  The raw string literals are removed in
> r907610
> 
> > It is important to understand what is causing the
> problem before trying to fix it. In this case, the problem
> is the expression is being evaluated twice.
> Yes, and the last evaluation happens in the freemarker, and
> \$ is not a valid escape in freemarker, that's why I
> introduced raw string literal.
> 
> Anyway just before giving up I found another solution,
> which I suppose is acceptable (is it???): instead of
> escaping $ sign, use its unicode value \x0024
> After the change a label example is this:  <value
> xml:lang="en">Uses the \x0024{date:dayStart(nowTimestamp,
> timeZone, locale)} UEL expression to set the default value
> to the start of today</value>

That still looks like a hack or a kludge, and it might not work if the UI label 
is used somewhere else. As I stated before, I believe the best solution is to 
double escape the expression in the form widget, then fix the renderer so that 
it handles the expression correctly.

It is the renderer that needs to be fixed, not the UI label.

-Adrian




Reply via email to