Hello,

You could do:
#if ( "$!doc.getValue('processOverview')" != "" )

You can call methods of a Java String from Velocity (if it's a String of
course):
${propValue.trim()}
${propValue.length()}

BR,
Jeremie


2014-03-24 17:49 GMT+01:00 DeHaynes <[email protected]>:

> I am trying to use Velocity to dynamically create the output for my form.
>  If
> a field doesn't have any value, then I want the code to not display.  So I
> came up with the following:
>
>     #if ($doc.getValue('processOverview')!='')
>     = PROCESS OVERVIEW =
>     <div style="padding-left: 25px;">
>       $doc.display('processOverview')
>     </div>
>     #end
>
> However, this is not working.  Velocity is ALWAYS finding something in the
> field even though when I go to edit it, there is nothing there.  Am I
> missing something?
>
> As a work around, I have tried to find a Trim function in velocity and also
> a Lenth function.  I haven't been able to find either of those.  Anyone
> have
> any suggestions?
>
>
>
> --
> View this message in context:
> http://xwiki.475771.n2.nabble.com/Detect-Empty-Fields-tp7589773.html
> Sent from the XWiki- Dev mailing list archive at Nabble.com.
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
>
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to