newline / line break on a UI page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-02-2014 04:32 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-02-2014 06:37 PM
Try :
<pre>
- <tr>
- <td>
- ${jvar_street} <br/>
- </td>
- </tr>
</pre>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2014 01:16 AM
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>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2017 10:30 AM
that was actually super helpful, thanks!