newline / line break on a UI page

conmic
Mega Guru

Hello everyone,

it seems I have trouble with an simple task.. I want to extract the street field of a stockroom (or company) to display it on a UI page.

I build a UI macro as I need the same structure on a few places, but I have the problem that the website doesn't resolve the newline/line break not properly.

I'm evaluating a GlideRecord and extracting the street value ${jvar_delivery_gr.getValue('location.street')}

after that it is automatically written into a variable as I use a UI macro, where I declare it like so:

 

       <tr>
           <td>
                   ${jvar_street}
           </td>
       </tr>

 

When I do this it shows up like this:

address line 1 address line 2 address line 3

 

but it should show:

address line 1

address line 2

address line 3

 

using the Element Inspector in firefox I can see that the inner HTML is properly showing the line breaks.

I tried several methods but all failed. the closest was to replace \n with <br/>, but this show then like shown below as the <br/> is doubled:

address line 1

 

address line 2

 

address line 3

 

 

I lost a lot of time with jelly today doing the simplest things... I hope somebody can help me.

 

Kind Regards

Michel

3 REPLIES 3

adiddigi
Tera Guru

Try :


<pre>


  1. <tr>  
  2.           <td>  
  3.                   ${jvar_street}   <br/>
  4.           </td>  
  5.       </tr>  





</pre>


thanks, that almost did the trick... I think that one was just too easy, or I should review my HTML/CSS classes...



I did it now like this for testing and it worked.   I will transfer the value to the <style> tag as next, oh boy, how embarrassing



      <tr>


          <td style="white-space:pre-line">


                  ${jvar_street}


          </td>


      </tr>


that was actually super helpful, thanks!