Velocity test for binary data

Questions and answers on developing, deploying and using plugins and JavaBeans

Velocity test for binary data

Postby wouter » Mon Apr 26, 2021 4:41 pm

Hi,

In a Velocity template I need to test for content in a binary column. The column is part of the dataset and all I need is to know if it contains data. With other datatypes I would simply test this by calling the variale

e.d.

#if($column)
<do something>
#end

but for the binary column I can nog get this to work.

I have tried

#if($binary_column)
#if($binary_column != '')
#if($binary_column.length >0)

but none seem to have an effect.

How do I test for this?

Wouter.
User avatar
wouter
 
Posts: 19
Joined: Mon Jul 23, 2012 1:17 pm

Re: Velocity test for binary data

Postby ptalbot » Mon Apr 26, 2021 7:10 pm

Try using:
Code: Select all
$null.isNull($yourVariable)

or
Code: Select all
$null.isNotNull($yourVariable)
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Re: Velocity test for binary data

Postby wouter » Wed Apr 28, 2021 11:39 am

Hi Patrick,

That did the trick. Thanks!

Wouter.
User avatar
wouter
 
Posts: 19
Joined: Mon Jul 23, 2012 1:17 pm


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 8 guests