How can I show the null values as an empty column?

0

I have a template person_report and I need the values of this concatenation not to be shown as null when a pdf is generated.

                <td th:text="|${person.address} ${person.address_number}  ${person.floor}  ${person.department}|">Static content</td>

deal with:

{person.address?} ${person.address_number?} ...

and with:

                <td th:text="|${person.address !=null} ? ${person.address_number !=null} ? ${person.floor !=null} ? ${person.department !=null} : '-'|"></td>
    
asked by Jeypi 10.08.2018 в 22:33
source

2 answers

0

You can do a validation where you ask if the field is null, you assign a space or empty quotes.

It would be something like this:

if (empty($person.address)) {
  person.address = " ";
}
    
answered by 10.08.2018 в 22:50
-1

you can do it like that

if($person.address_number == null){
   //asignación de los valores 
}
    
answered by 11.08.2018 в 00:56